<commit_before>import React, { Component } from 'react';
import { browserHistory } from 'react-router';
import DockerService from '../Service/DockerService';
import onValueChange from '../ChangeHandler/ChangeHandler';
import style from '../Form.css';

export default class Login extends Component {
  constructor(props) {
    super(props);

    this.state = {};

    this.login = this.login.bind(this);
    this.onKeyDown = this.onKeyDown.bind(this);
  }

  onKeyDown(event) {
    if (event.keyCode === 13) {
      return this.login();
    }
    return undefined;
  }

  login() {
    return DockerService.login(this.state.login, this.state.password)
      .then((data) => {
        browserHistory.push(this.props.redirect || '/');
        return data;
      });
  }

  render() {
    return (
      <div className={style.form}>
        <span>
          <input
            name="login"
            type="text"
            placeholder="login"
            onKeyDown={this.onKeyDown}
            onChange={e => onValueChange(this, 'login')(e.target.value)}
          />
        </span>
        <span>
          <input
            name="password"
            type="password"
            placeholder="password"
            onKeyDown={this.onKeyDown}
            onChange={e => onValueChange(this, 'password')(e.target.value)}
          />
        </span>
        <span>
          <button className={style.styledButton} onClick={this.login}>
            Login
          </button>
        </span>
      </div>
    );
  }
}

Login.propTypes = {
  redirect: React.PropTypes.string,
};

<commit_msg>Adding back button<commit_after>import React, { Component } from 'react';
import FaArrowLeft from 'react-icons/lib/fa/arrow-left';
import { browserHistory } from 'react-router';
import DockerService from '../Service/DockerService';
import onValueChange from '../ChangeHandler/ChangeHandler';
import style from '../Form.css';

export default class Login extends Component {
  constructor(props) {
    super(props);

    this.state = {};

    this.login = this.login.bind(this);
    this.onKeyDown = this.onKeyDown.bind(this);
  }

  onKeyDown(event) {
    if (event.keyCode === 13) {
      return this.login();
    }
    return undefined;
  }

  login() {
    return DockerService.login(this.state.login, this.state.password)
      .then((data) => {
        browserHistory.push(this.props.redirect || '/');
        return data;
      });
  }

  render() {
    return (
      <div className={style.form}>
        <span>
          <button
            className={style.styledButton}
            onClick={() => browserHistory.push('/')}
          >
            <FaArrowLeft /> Back
          </button>
        </span>
        <span>
          <input
            name="login"
            type="text"
            placeholder="login"
            onKeyDown={this.onKeyDown}
            onChange={e => onValueChange(this, 'login')(e.target.value)}
          />
        </span>
        <span>
          <input
            name="password"
            type="password"
            placeholder="password"
            onKeyDown={this.onKeyDown}
            onChange={e => onValueChange(this, 'password')(e.target.value)}
          />
        </span>
        <span>
          <button className={style.styledButton} onClick={this.login}>
            Login
          </button>
        </span>
      </div>
    );
  }
}

Login.propTypes = {
  redirect: React.PropTypes.string,
};


{'fraction_non_alphanumeric': 0.14318840579710146, 'fraction_numerical': 0.0011594202898550724, 'mean_word_length': 1.9801381692573403, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 39, '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': '4780567', 'n_tokens_mistral': 1006, 'n_tokens_neox': 992, 'n_words': 185}