<commit_before>var React = require('react')
var django = require('django')
var ErrorList = require('../../contrib/static/js/ErrorList')

let ChoiceForm = React.createClass({
  handleLabelChange: function (e) {
    var index = this.props.index
    var label = e.target.value
    this.props.updateChoiceLabel(index, label)
  },

  handleDelete: function () {
    this.props.deleteChoice(this.props.index)
  },

  render: function () {
    return (
      <div className="form-group">
        <label
          htmlFor={'id_choices-' + this.props.key + '-name'}>
          {django.gettext('Choice:')}
        </label>
        <input
          id={'id_choices-' + this.props.key + '-name'}
          name={'choices-' + this.props.key + '-name'}
          type="text"
          defaultValue={this.props.choice.label}
          onChange={this.handleLabelChange} />
        <div className="button-group">
          <button
            className="button button--light"
            onClick={this.handleDelete}
            type="button">
            <i className="fa fa-trash" />
          </button>
        </div>
        <ErrorList errors={this.props.errors} />
      </div>
    )
  }
})

module.exports = ChoiceForm
<commit_msg>hide label and add proper ids (key is for react internally only)<commit_after>var React = require('react')
var django = require('django')
var ErrorList = require('../../contrib/static/js/ErrorList')

let ChoiceForm = React.createClass({
  handleLabelChange: function (e) {
    var index = this.props.index
    var label = e.target.value
    this.props.updateChoiceLabel(index, label)
  },

  handleDelete: function () {
    this.props.deleteChoice(this.props.index)
  },

  render: function () {
    return (
      <div className="form-group">
        <label
          className="sr-only"
          htmlFor={'id_choices-' + this.props.index + '-name'}>
          {django.gettext('Choice') + ` #${this.props.index}:`}
        </label>
        <input
          id={'id_choices-' + this.props.index + '-name'}
          name={'choices-' + this.props.index + '-name'}
          type="text"
          defaultValue={this.props.choice.label}
          onChange={this.handleLabelChange} />
        <div className="button-group">
          <button
            className="button button--light"
            onClick={this.handleDelete}
            type="button">
            <i className="fa fa-trash" />
          </button>
        </div>
        <ErrorList errors={this.props.errors} />
      </div>
    )
  }
})

module.exports = ChoiceForm

{'fraction_non_alphanumeric': 0.15405723245785966, 'fraction_numerical': 0.0, 'mean_word_length': 2.218158890290038, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '4603755', 'n_tokens_mistral': 753, 'n_tokens_neox': 749, 'n_words': 141}