<commit_before>import React from 'react';

import atom from '../../state/atom';

import _ from 'mori';

let protonComponent = function (Component) {

    class ProtonComponent extends React.Component {

        static propTypes = {

            cursor: React.PropTypes.arrayOf(React.PropTypes.any)
        }

        /* Set initial proton state */
        componentWillMount() {

            this._protonState = atom.getIn(this.props.cursor);
        }

        /* Re-render component if proton state has been changed
           and update proton state
        */
        shouldComponentUpdate (nextProps) {

            let currentProton = this._protonState,
                nextProton = atom.getIn(nextProps.cursor);

            if (_.equals(currentProton, nextProton)) {

                return false;
            }
            else {

                this._protonState = nextProton;
                return true;
            }
        }

        /* Get data as plain JS data structure */
        getProtonState() {

            return _.toJs(this._protonState);
        }

        render() {

            return <Component protonState={this.getProtonState()} {...this.props} />;
        }
    }

    return ProtonComponent;<commit_msg>should be private method<commit_after>import React from 'react';

import atom from '../../state/atom';

import _ from 'mori';

let protonComponent = function (Component) {

    class ProtonComponent extends React.Component {

        static propTypes = {

            cursor: React.PropTypes.arrayOf(React.PropTypes.any)
        }

        /* Set initial proton state */
        componentWillMount() {

            this._protonState = atom.getIn(this.props.cursor);
        }

        /* Re-render component if proton state has been changed
           and update proton state
        */
        shouldComponentUpdate (nextProps) {

            let currentProton = this._protonState,
                nextProton = atom.getIn(nextProps.cursor);

            if (_.equals(currentProton, nextProton)) {

                return false;
            }
            else {

                this._protonState = nextProton;
                return true;
            }
        }

        /* Get data as plain JS data structure */
        _getProtonState() {

            return _.toJs(this._protonState);
        }

        render() {

            return <Component protonState={this._getProtonState()} {...this.props} />;
        }
    }

    return ProtonComponent;
{'fraction_non_alphanumeric': 0.09554395824969891, 'fraction_numerical': 0.0, 'mean_word_length': 1.6567164179104477, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7377753', 'n_tokens_mistral': 671, 'n_tokens_neox': 627, 'n_words': 154}