<commit_before>import React from 'react';

var Login = React.createClass({
  render: function(){
    return (
      <div className="ui form">
        <div className="ui small modal active" id="login">
          <div className="header">
            Login
          </div>
          <div className="content">
            <div className="field">
              <label>Email</label>
              <input type="email" id="email" placeholder="<EMAIL>"/>
            </div>

            <div className="field">
              <label>Password</label>
              <input type="password" id="password" placeholder="*******"/>
            </div>
          </div>

          <div className="actions">
            <button type="button" className="ui positive right labeled icon button">
              Login
              <i className="caret right icon"></i>
            </button>
          </div>
        </div>
      </div>
    )
  }
})

export default Login;<commit_msg>Use ES6 classes, some login behaviour<commit_after>import React from 'react';

class Login extends React.Component{
  constructor(props){
    super(props)

    this.state = { email: '', password: '' }

    // Really?? ES6 react...
    this.handle_submit=this.handle_submit.bind(this)
    this.update_password=this.update_password.bind(this)
    this.update_email=this.update_email.bind(this)
  }
  update_password(event){
    this.setState({password: event.target.value})
  }
  update_email(event){
    this.setState({email: event.target.value})
  }
  handle_submit(){
    if ($(this.refs.el).form('validate form')){
      console.log("Try log in")
    }
  }
  componentDidMount( ){
    self=this
    $(this.refs.el).form({
      on: 'blur',
      fields: {
        email: 'email',
        password: '<PASSWORD>]'
      }
    })
    $(self.refs.el).find('[type=email]').focus()
  }
  render(){
    return (
      <form className="ui form" ref="el">
        <div className="ui small modal active" id="login">
          <div className="header">
            Login
          </div>

          <div className="content">
            <div className="field">
              <label>Email</label>
              <input type="email" name="email" placeholder="<EMAIL>"
                onChange={this.update_email} value={this.state.email}/>
            </div>

            <div className="field">
              <label>Password</label>
              <input type="password" name="password" placeholder="*******"
                onChange={this.update_password} value={this.state.password}/>
            </div>
            <div class="ui error message"></div>
          </div>

          <div className="actions">
            <button type="button" className="ui positive right labeled icon button"
              onClick={this.handle_submit}>
              Login
              <i className="caret right icon"></i>
            </button>
          </div>
        </div>
      </form>
    )
  }
}

export default Login;
{'fraction_non_alphanumeric': 0.15189445196211096, 'fraction_numerical': 0.0006765899864682003, 'mean_word_length': 1.9838546922300706, 'pattern_counts': {'":': 0, '<': 56, '<?xml version=': 0, '>': 56, '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': '3494109', 'n_tokens_mistral': 825, 'n_tokens_neox': 814, 'n_words': 177}