<commit_before>import React, { PropTypes, PureComponent } from 'react';
import Wrapper from './ReduxFormMaterialUiWrapper';

class ReactAmountField extends PureComponent {

  constructor(props) {
    super(props);
    this.state = {
      unflushedValue: '',
    };
    if (this.props.value && this.props.value !== '') {
      this.state.unflushedValue = this.props.value / 100;
    }
  }

  static propTypes = {
    value: PropTypes.text,
  };

  proxyEvent(target) {
    return (event) => {
      if (target) {
        const eventValue = event.target.value;
        if (eventValue && eventValue !== '') {
          this.setState({ unflushedValue: eventValue.toString() });
          if (!eventValue.toString().endsWith('.')) {
            const oldValue = eventValue.toString().replace(/[^\d.,]/g, '').replace(',', '.');
            const newEvent = event;
            newEvent.target.value = parseInt(oldValue * 100, 10).toString();
            target(newEvent);
          }
        } else {
          this.setState({ unflushedValue: '' });
          target(event);
        }
      }
    };
  }

  render() {
    const props = { ...this.props };
    props.value = this.state.unflushedValue;
    props.onChange = this.proxyEvent(this.props.onChange);
    props.onBlur = this.proxyEvent(this.props.onBlur);
    props.onDrop = this.proxyEvent(this.props.onDrop);
    delete props.children;
    return <div>{React.cloneElement(this.props.children, { ...props })}</div>;<commit_msg>wrong proptype<commit_after>import React, { PropTypes, PureComponent } from 'react';
import Wrapper from './ReduxFormMaterialUiWrapper';

class ReactAmountField extends PureComponent {

  constructor(props) {
    super(props);
    this.state = {
      unflushedValue: '',
    };
    if (this.props.value && this.props.value !== '') {
      this.state.unflushedValue = this.props.value / 100;
    }
  }

  static propTypes = {
    value: PropTypes.string,
  };

  proxyEvent(target) {
    return (event) => {
      if (target) {
        const eventValue = event.target.value;
        if (eventValue && eventValue !== '') {
          this.setState({ unflushedValue: eventValue.toString() });
          if (!eventValue.toString().endsWith('.')) {
            const oldValue = eventValue.toString().replace(/[^\d.,]/g, '').replace(',', '.');
            const newEvent = event;
            newEvent.target.value = parseInt(oldValue * 100, 10).toString();
            target(newEvent);
          }
        } else {
          this.setState({ unflushedValue: '' });
          target(event);
        }
      }
    };
  }

  render() {
    const props = { ...this.props };
    props.value = this.state.unflushedValue;
    props.onChange = this.proxyEvent(this.props.onChange);
    props.onBlur = this.proxyEvent(this.props.onBlur);
    props.onDrop = this.proxyEvent(this.props.onDrop);
    delete props.children;
    return <div>{React.cloneElement(this.props.children, { ...props })}</div>;
{'fraction_non_alphanumeric': 0.15862301721228483, 'fraction_numerical': 0.005399932500843739, 'mean_word_length': 2.50354609929078, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '2814888', 'n_tokens_mistral': 911, 'n_tokens_neox': 895, 'n_words': 156}