<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import Recaptcha from 'react-gcaptcha';
import Button from './Button';
import ErrorList from './ErrorList';
import OrganizationSelect from './OrganizationSelect';


const RegisterForm = ({
  onFormSubmit,
  fields,
  fieldErrors,
  onInputChange,
  callback,
  organizations,
  }, context) => {
  const language = context.language.RegisterView;
  return (
    <form className="center" onSubmit={onFormSubmit}>
      <label htmlFor="email" style={{ textTransform: 'capitalize' }}>{language.email}:</label>
      <input
        name="email"
        type="text"
        value={fields.email}
        onChange={onInputChange}
      />
      <label htmlFor="password" style={{ textTransform: 'capitalize' }}>{language.password}:</label>
      <input
        name="password"
        value={fields.password}
        onChange={onInputChange}
        type="password"
      />
      <label htmlFor="confirmpassword" style={{ textTransform: 'capitalize' }}>{language.confirmPassword}:</label>
      <input
        name="confirmpassword"
        value={fields.confirmpassword}
        onChange={onInputChange}
        type="password"
      />
      <OrganizationSelect
        onInputChange={onInputChange}
        fields={fields}
        organizations={organizations}
      />
      <Recaptcha
        sitekey="<KEY>"
        verifyCallback={callback}
      />
      <ErrorList errors={fieldErrors} />
      <Button form>{language.registerBtn}</Button>
    </form>
  );
};

RegisterForm.contextTypes = {
  language: PropTypes.object,
};

RegisterForm.propTypes = {
  onFormSubmit: PropTypes.func.isRequired,
  fields: PropTypes.shape({
    email: PropTypes.string,
    password: PropTypes.string,
    confirmPassword: PropTypes.string,
    org: PropTypes.string,
    newOrg: PropTypes.string,
  }).isRequired,
  callback: PropTypes.func.isRequired,
  onInputChange: PropTypes.func.isRequired,
  organizations: PropTypes.arrayOf(
    PropTypes.string,
  ).isRequired,
  fieldErrors: PropTypes.arrayOf(
    PropTypes.string,
  ).isRequired,
};

export default RegisterForm;<commit_msg>moved propTypes and contextTypes to the top<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import Recaptcha from 'react-gcaptcha';
import Button from './Button';
import ErrorList from './ErrorList';
import OrganizationSelect from './OrganizationSelect';

const propTypes = {
  onFormSubmit: PropTypes.func.isRequired,
  fields: PropTypes.shape({
    email: PropTypes.string,
    password: PropTypes.string,
    confirmPassword: PropTypes.string,
    org: PropTypes.string,
    newOrg: PropTypes.string,
  }).isRequired,
  callback: PropTypes.func.isRequired,
  onInputChange: PropTypes.func.isRequired,
  organizations: PropTypes.arrayOf(
    PropTypes.string,
  ).isRequired,
  fieldErrors: PropTypes.arrayOf(
    PropTypes.string,
  ).isRequired,
};

const contextTypes = {
  language: PropTypes.object,
};

const RegisterForm = ({
  onFormSubmit,
  fields,
  fieldErrors,
  onInputChange,
  callback,
  organizations,
  }, context) => {
  const language = context.language.RegisterView;
  return (
    <form className="center" onSubmit={onFormSubmit}>
      <label htmlFor="email" style={{ textTransform: 'capitalize' }}>{language.email}:</label>
      <input
        name="email"
        type="text"
        value={fields.email}
        onChange={onInputChange}
      />
      <label htmlFor="password" style={{ textTransform: 'capitalize' }}>{language.password}:</label>
      <input
        name="password"
        value={fields.password}
        onChange={onInputChange}
        type="password"
      />
      <label htmlFor="confirmpassword" style={{ textTransform: 'capitalize' }}>{language.confirmPassword}:</label>
      <input
        name="confirmpassword"
        value={fields.confirmpassword}
        onChange={onInputChange}
        type="password"
      />
      <OrganizationSelect
        onInputChange={onInputChange}
        fields={fields}
        organizations={organizations}
      />
      <Recaptcha
        sitekey="<KEY>Z"
        verifyCallback={callback}
      />
      <ErrorList errors={fieldErrors} />
      <Button form>{language.registerBtn}</Button>
    </form>
  );
};

RegisterForm.propTypes = propTypes;
RegisterForm.contextTypes = contextTypes;

export default RegisterForm;
{'fraction_non_alphanumeric': 0.1256544502617801, 'fraction_numerical': 0.0, 'mean_word_length': 3.3634558093346576, 'pattern_counts': {'":': 0, '<': 37, '<?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': '4213489', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1271, 'n_words': 249}