<commit_before>import React from "react";
import PropTypes from "prop-types";

class NavSelect extends React.Component {
  constructor(props) {
    super(props);
    this.state = { choices: [], error: false };
  }

  setChoice(choice) {
    return e => {
      e.preventDefault();
      let previousChoices = this.props.value;
      let newChoices;

      if (!previousChoices.includes(choice)) {
        newChoices = Array.concat(previousChoices, choice);
      } else {
        previousChoices.splice(previousChoices.indexOf(choice), 1);
        newChoices = previousChoices;
      }

      if (newChoices.length <= this.props.max) {
        this.props.onChange(newChoices);
      }
    };
  }

  render() {
    const { choices, value } = this.props;

    return (
      <div>
        <ul className="nav nav-pills">
          {choices.map(choice => (
            <li
              key={choice.value}
              className={value.includes(choice.value) ? "active" : ""}
            >
              <a href="#" onClick={this.setChoice(choice.value)}>
                <i
                  className={
                    "fa " +
                    (value.includes(choice.value)
                      ? "fa-check-circle"
                      : "fa-circle-o")<commit_msg>fix(lib): .concat method for ie and safary<commit_after>import React from "react";
import PropTypes from "prop-types";

class NavSelect extends React.Component {
  constructor(props) {
    super(props);
    this.state = { choices: [], error: false };
  }

  setChoice(choice) {
    return e => {
      e.preventDefault();
      let previousChoices = this.props.value;
      let newChoices;

      if (!previousChoices.includes(choice)) {
        newChoices = previousChoices.concat(choice);
      } else {
        previousChoices.splice(previousChoices.indexOf(choice), 1);
        newChoices = previousChoices;
      }

      if (newChoices.length <= this.props.max) {
        this.props.onChange(newChoices);
      }
    };
  }

  render() {
    const { choices, value } = this.props;

    return (
      <div>
        <ul className="nav nav-pills">
          {choices.map(choice => (
            <li
              key={choice.value}
              className={value.includes(choice.value) ? "active" : ""}
            >
              <a href="#" onClick={this.setChoice(choice.value)}>
                <i
                  className={
                    "fa " +
                    (value.includes(choice.value)
                      ? "fa-check-circle"
                      : "fa-circle-o")
{'fraction_non_alphanumeric': 0.12977396726422447, 'fraction_numerical': 0.000779423226812159, 'mean_word_length': 1.7811484290357529, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3816507', 'n_tokens_mistral': 768, 'n_tokens_neox': 725, 'n_words': 134}