<commit_before>
var CommentBox = React.createClass({
  
  // loadCommentsFromServer: function() {
  //   $.ajax({
  //     url: this.props.url,
  //     dataType: 'json',
  //     cache: false,
  //     success: function(data) {
  //       this.setState({data: data});
  //     }.bind(this),
  //     error: function(xhr, status, err) {
  //       console.error(this.props.url, status, err.toString());
  //     }.bind(this)
  //   });
  // },
  handleCommentSubmit: function(comment) {
    $.ajax({
      url: this.props.url + 'push',
      dataType: 'json',
      type: 'POST',
      data: comment,
      success: function(data) {
        console.log('success');
      }.bind(this),
      error: function(xhr, status, err) {
        console.error(this.props.url, status, err.toString());
      }.bind(this)
    });
  },
  getInitialState: function() {
    return {data: []};
  },
  componentDidMount: function() {
    this.loadCommentsFromServer();
  },
  render: function() {
    return (
      <div className="commentBox">
        <CommentForm onCommentSubmit={this.handleCommentSubmit} />
      </div>
    );
  }
});
var CommentForm = React.createClass({
  handleSubmit: function(e) {
    e.preventDefault();
    var to = this.refs.to.value.trim();
    var message = this.refs.message.value.trim();
    if (!to || !message) {
      return;
    }
    this.props.onCommentSubmit({userId: author, message: text});
    this.refs.to.value = '';
    this.refs.message.value = '';
    return;
  },
  render: function() {
    return (
      <div className="commentForm">
      <form className="commentForm" onSubmit={this.handleSubmit}>
        <input type="text" placeholder="To" ref="to" />
        <input type="text" placeholder="Say something..." ref="message" />
        <input type="submit" value="Post" />
      </form>
      </div>
    );
  }<commit_msg>fix error<commit_after>
var CommentBox = React.createClass({
  
  // loadCommentsFromServer: function() {
  //   $.ajax({
  //     url: this.props.url,
  //     dataType: 'json',
  //     cache: false,
  //     success: function(data) {
  //       this.setState({data: data});
  //     }.bind(this),
  //     error: function(xhr, status, err) {
  //       console.error(this.props.url, status, err.toString());
  //     }.bind(this)
  //   });
  // },
  handleCommentSubmit: function(comment) {
    $.ajax({
      url: this.props.url + 'push',
      dataType: 'json',
      type: 'POST',
      data: comment,
      success: function(data) {
        console.log('success');
      }.bind(this),
      error: function(xhr, status, err) {
        console.error(this.props.url, status, err.toString());
      }.bind(this)
    });
  },
  getInitialState: function() {
  },
  componentDidMount: function() {
  },
  render: function() {
    return (
      <div className="commentBox">
        <CommentForm onCommentSubmit={this.handleCommentSubmit} />
      </div>
    );
  }
});
var CommentForm = React.createClass({
  handleSubmit: function(e) {
    e.preventDefault();
    var to = this.refs.to.value.trim();
    var message = this.refs.message.value.trim();
    if (!to || !message) {
      return;
    }
    this.props.onCommentSubmit({userId: to, message: message});
    this.refs.to.value = '';
    this.refs.message.value = '';
    return;
  },
  render: function() {
    return (
      <div className="commentForm">
      <form className="commentForm" onSubmit={this.handleSubmit}>
        <input type="text" placeholder="To" ref="to" />
        <input type="text" placeholder="Say something..." ref="message" />
        <input type="submit" value="Post" />
      </form>
      </div>
    );
  }
{'fraction_non_alphanumeric': 0.18057455540355677, 'fraction_numerical': 0.0, 'mean_word_length': 2.3883225208526415, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '5294731', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1157, 'n_words': 218}