<commit_before>const React = require('react');
const {PropTypes} = React;
const ReactSelect = require('react-select');

class Select extends React.Component {
  render() {
    const SelectClass = this.props.async ? ReactSelect.Async : ReactSelect;
    return (
      <div className="cf-select">
        {this.props.label && <label>{this.props.label}</label>}
        <SelectClass
          // Simplify if this isnt a searchable select
          searchable={this.props.searchable}
          clearable={this.props.searchable}
          backspaceRemoves={this.props.searchable}

          onChange={this.props.onChange}
          onBlur={this.props.onBlur}
          onFocus={this.props.onFocus}
          loadOptions={this.props.loadOptions}

          multi={this.props.multi}
          value={this.props.value}
          options={this.props.options}
          placeholder={this.props.placeholder}
          disabled={this.props.disabled}/>
      </div>
    );
  }
}

Select.propTypes = {
  label: PropTypes.string,

  onChange: PropTypes.func.isRequired,
  onBlur: PropTypes.func,
  onFocus: PropTypes.func,
  loadOptions: PropTypes.func,

  multi: PropTypes.bool,
  searchable: PropTypes.bool,
  async: PropTypes.bool,
  disabled: PropTypes.bool,

  value: PropTypes.any,
  options: PropTypes.arrayOf(PropTypes.shape({
    label: PropTypes.string.isRequired,
    value: PropTypes.any.isRequired,
    disabled: PropTypes.bool
  })),
  placeholder: PropTypes.string
};

Select.defaultProps = {
  multi: false,
  searchable: false,
  async: false
};

module.exports = Select;<commit_msg>Add cache option to Select (#56)<commit_after>const React = require('react');
const {PropTypes} = React;
const ReactSelect = require('react-select');

class Select extends React.Component {
  render() {
    const SelectClass = this.props.async ? ReactSelect.Async : ReactSelect;
    return (
      <div className="cf-select">
        {this.props.label && <label>{this.props.label}</label>}
        <SelectClass
          // Simplify if this isnt a searchable select
          searchable={this.props.searchable}
          clearable={this.props.searchable}
          backspaceRemoves={this.props.searchable}

          onChange={this.props.onChange}
          onBlur={this.props.onBlur}
          onFocus={this.props.onFocus}
          loadOptions={this.props.loadOptions}

          multi={this.props.multi}
          value={this.props.value}
          options={this.props.options}
          placeholder={this.props.placeholder}
          disabled={this.props.disabled}
          cache={this.props.cache}/>
      </div>
    );
  }
}

Select.propTypes = {
  label: PropTypes.string,

  onChange: PropTypes.func.isRequired,
  onBlur: PropTypes.func,
  onFocus: PropTypes.func,
  loadOptions: PropTypes.func,

  multi: PropTypes.bool,
  searchable: PropTypes.bool,
  async: PropTypes.bool,
  disabled: PropTypes.bool,
  cache: PropTypes.bool,

  value: PropTypes.any,
  options: PropTypes.arrayOf(PropTypes.shape({
    label: PropTypes.string.isRequired,
    value: PropTypes.any.isRequired,
    disabled: PropTypes.bool
  })),
  placeholder: PropTypes.string
};

Select.defaultProps = {
  multi: false,
  searchable: false,
  async: false,
  cache: true
};

module.exports = Select;
{'fraction_non_alphanumeric': 0.1246936274509804, 'fraction_numerical': 0.0006127450980392157, 'mean_word_length': 3.0012254901960786, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '6635240', 'n_tokens_mistral': 968, 'n_tokens_neox': 986, 'n_words': 179}