<commit_before>(function () {
    'use strict';

    var RoomOccupancyInput = require('./index'),
        React = require('react'),

        Container = React.createClass({
            getInitialState: function () {
                return {value: {adults: 2, children: [{age: 5}, {age: 7}]}};
            },

            render: function () {
                return React.createElement(RoomOccupancyInput, {
                    value: this.state.value,

                    onChange: function (roomOccupancy) {
                        this.setState({value: roomOccupancy});
                    }.bind(this)
                });
            }
        });

    React.render(React.createElement(Container), global.document.body);
}());<commit_msg>New demo code with the validity display<commit_after>(function () {
    'use strict';

    var RoomOccupancyInput = require('./index'),
        React = require('react'),

        Container = React.createClass({
            getInitialState: function () {
                return {
                    value: {
                        adults: 2,
                        children: [{age: 5}, {age: 7}]
                    },

                    valid: true
                };
            },

            render: function () {
                return React.DOM.div({}, [
                    React.createElement(RoomOccupancyInput, {
                        key: 'k0',
                        value: this.state.value,

                        onChange: function (roomOccupancy) {
                            this.setState({value: roomOccupancy, valid: true});
                        }.bind(this),

                        onInvalidity: function () {
                            this.setState({valid: false});
                        }.bind(this)
                    }),

                    React.DOM.div({key: 'k1'}, this.state.valid ? 'Valid' : 'Invalid')
                ]);
            }
        });

    React.render(React.createElement(Container), global.document.body);
}());
{'fraction_non_alphanumeric': 0.12574257425742574, 'fraction_numerical': 0.0039603960396039604, 'mean_word_length': 1.2184412733260153, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2777277', 'n_tokens_mistral': 505, 'n_tokens_neox': 470, 'n_words': 93}