<commit_before>import React from 'react';

import Inputs from './inputs';

import Editor from './editor';
import Display from 'react-jupyter-display-area';

import Immutable from 'immutable';

import {
  executeCell,
} from '../../actions';

export default class CodeCell extends React.Component {
  static propTypes = {
    cell: React.PropTypes.any,
    displayOrder: React.PropTypes.instanceOf(Immutable.List),
    id: React.PropTypes.string,
    language: React.PropTypes.string,
    theme: React.PropTypes.string,
    transforms: React.PropTypes.instanceOf(Immutable.Map),
  };

  static contextTypes = {
    channels: React.PropTypes.object,
    dispatch: React.PropTypes.func,
  };

  keyDown(e) {
    if(e.key !== 'Enter') {
      return;
    }

    const shiftXORctrl = (e.shiftKey || e.ctrlKey) && !(e.shiftKey && e.ctrlKey);
    if(!shiftXORctrl) {
      return;
    }

    if (e.shiftKey) {
      // TODO: Remove this, as it should be created if at the end of document only
      // this.context.dispatch(createCellAfter('code', this.props.id));

      // should instead be
      // this.context.dispatch(nextCell(this.props.id));
    }

    this.context.dispatch(executeCell(this.props.id,
                                      this.props.cell.get('source')));
  }

  render() {
    return (
      <div className='code_cell'>
        <div className='input_area' onKeyDown={this.keyDown.bind(this)}>
          <Inputs executionCount={this.props.cell.get('execution_count')}/>
          <Editor
            id={this.props.id}
            input={this.props.cell.get('source')}
            language={this.props.language}
          />
        </div>
        <Display className='cell_display'
                 outputs={this.props.cell.get('outputs')}
                 displayOrder={this.props.displayOrder}
                 transforms={this.props.transforms}
        />
      </div>
    );
  }
}
<commit_msg>eslint the code-cell<commit_after>import React from 'react';

import Inputs from './inputs';

import Editor from './editor';
import Display from 'react-jupyter-display-area';

import Immutable from 'immutable';

import {
  executeCell,
} from '../../actions';

export default class CodeCell extends React.Component {
  static propTypes = {
    cell: React.PropTypes.any,
    displayOrder: React.PropTypes.instanceOf(Immutable.List),
    id: React.PropTypes.string,
    language: React.PropTypes.string,
    theme: React.PropTypes.string,
    transforms: React.PropTypes.instanceOf(Immutable.Map),
  };

  static contextTypes = {
    channels: React.PropTypes.object,
    dispatch: React.PropTypes.func,
  };

  constructor() {
    super();
    this.keyDown = this.keyDown.bind(this);
  }

  keyDown(e) {
    if (e.key !== 'Enter') {
      return;
    }

    const shiftXORctrl = (e.shiftKey || e.ctrlKey) && !(e.shiftKey && e.ctrlKey);
    if (!shiftXORctrl) {
      return;
    }

    if (e.shiftKey) {
      // TODO: Remove this, as it should be created if at the end of document only
      // this.context.dispatch(createCellAfter('code', this.props.id));

      // should instead be
      // this.context.dispatch(nextCell(this.props.id));
    }

    this.context.dispatch(executeCell(this.props.id,
                                      this.props.cell.get('source')));
  }

  render() {
    return (
      <div className="code_cell">
        <div className="input_area" onKeyDown={this.keyDown}>
          <Inputs executionCount={this.props.cell.get('execution_count')} />
          <Editor
            id={this.props.id}
            input={this.props.cell.get('source')}
            language={this.props.language}
          />
        </div>
        <Display
          className="cell_display"
          outputs={this.props.cell.get('outputs')}
          displayOrder={this.props.displayOrder}
          transforms={this.props.transforms}
        />
      </div>
    );
  }
}

{'fraction_non_alphanumeric': 0.14109799897383274, 'fraction_numerical': 0.0, 'mean_word_length': 2.414185639229422, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5264865', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1178, 'n_words': 222}