<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';


// Listen for escape key being pressed and call `onEscape`
export default class EscapeListener extends React.Component {
  constructor(props) {
    super(props);
    this.onKeyUp = this.onKeyUp.bind(this);
    this.onClick = this.onClick.bind(this);
  }

  onKeyUp(e) {
    const {onEscape} = this.props;
    if (e.which === 27) onEscape();
  }

  onClick(e) {
    const {escapeOnUnhandledClick, onEscape} = this.props;
    if (escapeOnUnhandledClick) onEscape();
  }

  render() {
    const {className, children, style} = this.props;
    const classNameString = _.compact([className, 'EscapeListener']).join(' ');
    return (
      <div
        className={classNameString}
        style={style}
        onKeyUp={this.onKeyUp}
        onClick={this.onClick}>{children}</div>
    );
  }
}
EscapeListener.propTypes = {
  onEscape: PropTypes.func.isRequired,
  children: PropTypes.node.isRequired,
  escapeOnUnhandledClick: PropTypes.bool,
  className: PropTypes.string,
  style: PropTypes.object
};
<commit_msg>Smaller change to EscapeListener<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';


// Listen for escape key being pressed and call `onEscape`
export default class EscapeListener extends React.Component {
  constructor(props) {
    super(props);
    this.onKeyUp = this.onKeyUp.bind(this);
    this.onClick = this.onClick.bind(this);
  }

  onKeyUp(e) {
    const {onEscape} = this.props;
    if (e.which === 27) onEscape();
  }

  onClick(e) {
    const {escapeOnUnhandledClick, onEscape} = this.props;
    if (escapeOnUnhandledClick) onEscape();
  }

  render() {
    const {className, children, style, escapeOnUnhandledClick} = this.props;
    const classNameString = _.compact([className, 'EscapeListener']).join(' ');
    return (
      <div
        className={classNameString}
        style={style}
        onKeyUp={this.onKeyUp}
        onClick={escapeOnUnhandledClick && this.onClick}>{children}</div>
    );
  }
}
EscapeListener.propTypes = {
  onEscape: PropTypes.func.isRequired,
  children: PropTypes.node.isRequired,
  escapeOnUnhandledClick: PropTypes.bool,
  className: PropTypes.string,
  style: PropTypes.object
};

{'fraction_non_alphanumeric': 0.12755768393556813, 'fraction_numerical': 0.0017414018284719198, 'mean_word_length': 3.7186858316221767, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1455615', 'n_tokens_mistral': 743, 'n_tokens_neox': 742, 'n_words': 155}