<commit_before>import React, {Component, PropTypes} from 'react';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {map} from 'react-immutable-proptypes';
import App from '../components/App';
import * as TetrisActions from '../actions/index';
import * as sides from '../constants/MoveSide';
import {getRandomDetails} from '../core/getRandomDetails';
import {checkAroundDetail, inc, echo} from '../core/checkAroundDetail';

class AppContainer extends Component {
  constructor(props) {
    super();
    this.handleKeyDown = this.handleKeyDown.bind(this);
    this.handleStartGame = this.handleStartGame.bind(this);
    this.handleCycle = this.handleCycle.bind(this);
    this.handleOverGame = this.handleOverGame.bind(this);
  }

  componentDidMount() {
    window.addEventListener('keydown', this.handleKeyDown);
    this.handleStartGame();
  }

  handleKeyDown(e) {
    /* eslint indent: 0 */
    switch (e.keyCode) {
    case 37:
    case 65:
        return this.props.actions.moveDetail(sides.MOVE_LEFT);
    case 39:
    case 68:
        return this.props.actions.moveDetail(sides.MOVE_RIGHT);
    case 13:
    case 32:
        return this.props.actions.rotateDetail();
    case 80:
        return this.handleStartGame();
    default:
        return null;
    }
  }

  handleCycle(e) {
    const nextStep = {};
    nextStep.nextDetail = true;
    nextStep.moveDown = null;
    nextStep.gameOver = false;

    this.props.world.get('map').forEach((row, y) => {
      let completeRow = true;
<commit_msg>add handle key Esc within <AppContainer /><commit_after>import React, {Component, PropTypes} from 'react';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {map} from 'react-immutable-proptypes';
import App from '../components/App';
import * as TetrisActions from '../actions/index';
import * as sides from '../constants/MoveSide';
import {getRandomDetails} from '../core/getRandomDetails';
import {checkAroundDetail, inc, echo} from '../core/checkAroundDetail';

class AppContainer extends Component {
  constructor(props) {
    super();
    this.handleKeyDown = this.handleKeyDown.bind(this);
    this.handleStartGame = this.handleStartGame.bind(this);
    this.handleCycle = this.handleCycle.bind(this);
    this.handleOverGame = this.handleOverGame.bind(this);
  }

  componentDidMount() {
    window.addEventListener('keydown', this.handleKeyDown);
    this.handleStartGame();
  }

  handleKeyDown(e) {
    /* eslint indent: 0 */
    switch (e.keyCode) {
    case 37:
    case 65:
        this.props.actions.moveDetail(sides.MOVE_LEFT);
        break;
    case 39:
    case 68:
        this.props.actions.moveDetail(sides.MOVE_RIGHT);
        break;
    case 13:
    case 32:
        this.props.actions.rotateDetail();
        break;
    case 80:
        this.handleStartGame();
        break;
    case 27:
        this.handleOverGame();
        break;
    default:
        break;
    }
  }

  handleCycle(e) {
    const nextStep = {};
    nextStep.nextDetail = true;
    nextStep.moveDown = null;
    nextStep.gameOver = false;

    this.props.world.get('map').forEach((row, y) => {
      let completeRow = true;

{'fraction_non_alphanumeric': 0.1310193871169481, 'fraction_numerical': 0.010006253908692933, 'mean_word_length': 3.2092105263157893, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1662788', 'n_tokens_mistral': 1019, 'n_tokens_neox': 983, 'n_words': 219}