<commit_before>import React, { PropTypes } from 'react';
import { connect }          from 'react-redux';
import ImmutablePropTypes   from 'react-immutable-proptypes';

import * as AuthActions       from 'actions/AuthActions';

@connect(state => ({auth: state.auth}), AuthActions)
export default class Login extends React.Component {
  static propTypes = {
    login:  PropTypes.func.isRequired,
    logout: PropTypes.func.isRequired,
    //auth:   ImmutablePropTypes.mapOf(
    //  ImmutablePropTypes.contains({
    //    error: PropTypes.bool,
    //    user:  PropTypes.string
    //  })
    //)
  };

  handleSubmit = (e) => {
    e.preventDefault();

    let login = this.refs.login;
    let pass = this.refs.pass;
    this.props.login(login.value, pass.value);

    login.value = pass.value = '';
  };

  componentDidUpdate() {
    if (this.props.auth.get('error')) {
      this.refs.login.focus();<commit_msg>Fix ImmutablePropTypes validation in Login component.<commit_after>import React, { PropTypes } from 'react';
import { connect }          from 'react-redux';
import ImmutablePropTypes   from 'react-immutable-proptypes';

import * as AuthActions       from 'actions/AuthActions';

@connect(state => ({auth: state.auth}), AuthActions)
export default class Login extends React.Component {
  static propTypes = {
    login:  PropTypes.func.isRequired,
    logout: PropTypes.func.isRequired,
    auth:   ImmutablePropTypes.shape({
      user:  PropTypes.string,
      error: PropTypes.bool,
    })
  };

  handleSubmit = (e) => {
    e.preventDefault();

    let login = this.refs.login;
    let pass = this.refs.pass;
    this.props.login(login.value, pass.value);

    login.value = pass.value = '';
  };

  componentDidUpdate() {
    if (this.props.auth.get('error')) {
      this.refs.login.focus();
{'fraction_non_alphanumeric': 0.13741721854304637, 'fraction_numerical': 0.0, 'mean_word_length': 3.0833333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2730444', 'n_tokens_mistral': 559, 'n_tokens_neox': 560, 'n_words': 119}