<commit_before>import React from 'react';
import stores from 'stores';


export default React.createClass({
    displayName: "ImageSelect",

    propTypes: {
      onChange: React.PropTypes.func.isRequired,
      imageId: React.PropTypes.number.isRequired
    },

    handleChange: function(e){
      let image_id = e.target.value,
          images = this.getUserImages(),
          image = images.get(image_id);
      this.props.onChange(image);
    },

    getUserImages: function() {
      let username = stores.ProfileStore.get().get('username'),
          images = stores.ImageStore.fetchWhere({
              created_by__username: username
          })
      return images;
    },

    renderImage: function(image){
      return (
        <option key={image.id} value={image.id}>
          {image.get('name')}
        </option>
      )
    },

    render: function () {
      var imageId = this.props.imageId,
          images = this.getUserImages(),
          options;

      if(!images) return <div className="loading"/>;

      options = images.map(this.renderImage);

      return (
        <div className="form-group">
          <h4 htmlFor="Image" className="control-label">Change Image</h4>
          <div className="alert alert-danger">
            <strong>Warning: </strong>
            Changing this value will move this version to a different image you own.
          </div>
          <div className="help-block">
            Select the Image that best describes this image.
          </div><commit_msg>Curse you missing semi-colon<commit_after>import React from 'react';
import stores from 'stores';


export default React.createClass({
    displayName: "ImageSelect",

    propTypes: {
      onChange: React.PropTypes.func.isRequired,
      imageId: React.PropTypes.number.isRequired
    },

    handleChange: function(e){
      let image_id = e.target.value,
          images = this.getUserImages(),
          image = images.get(image_id);
      this.props.onChange(image);
    },

    getUserImages: function() {
      let username = stores.ProfileStore.get().get('username'),
          images = stores.ImageStore.fetchWhere({
              created_by__username: username
          });
      return images;
    },

    renderImage: function(image){
      return (
        <option key={image.id} value={image.id}>
          {image.get('name')}
        </option>
      )
    },

    render: function () {
      var imageId = this.props.imageId,
          images = this.getUserImages(),
          options;

      if(!images) return <div className="loading"/>;

      options = images.map(this.renderImage);

      return (
        <div className="form-group">
          <h4 htmlFor="Image" className="control-label">Change Image</h4>
          <div className="alert alert-danger">
            <strong>Warning: </strong>
            Changing this value will move this version to a different image you own.
          </div>
          <div className="help-block">
            Select the Image that best describes this image.
          </div>
{'fraction_non_alphanumeric': 0.12041884816753927, 'fraction_numerical': 0.0013089005235602095, 'mean_word_length': 2.2280887011615627, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '3022775', 'n_tokens_mistral': 842, 'n_tokens_neox': 823, 'n_words': 198}