<commit_before>'use strict';

var React = require('react/addons');
var zip = require('annozip');


module.exports = React.createClass({
    render() {
        var header = this.props.header || {};
        var data = this.props.data || [];
        var columns = this.props.columns || [];

        var cx = React.addons.classSet;

        // XXX: don't pass these props to table. maybe there's a cleaner way...
        delete this.props.header;
        delete this.props.data;
        delete this.props.columns;

        return (
            <table {...this.props}>
                <thead>
                    <tr>
                        {columns.map((column, i) => {
                            var z = zip(header);
                            var columnHeader = z && zip.toObject(z.map((pair) => {
                                if(pair[0].indexOf('on') === 0) {
                                    return [pair[0], pair[1].bind(null, column)];
                                }

                                return pair;
                            }));

                            return <th
                                key={i + '-header'}
                                className={cx(column.classes)}
                                {...columnHeader}
                            >
                                {column.header}
                            </th>;
                        })}
                    </tr>
                </thead>
                <tbody>
                    {data.map((row, i) => <tr key={i + '-row'}>{
                        columns.map((column, j) => {
                            var value = row[column.property];
                            var cell = column.cell;

                            if(cell) {
                                var props = cell(column.property, value, i, j)
                                var content = props.value;

                                // XXX: ugly
                                delete props.value;

                                return <td key={j + '-cell'} {...props}>{content}</td>
                            }
                            else {<commit_msg>Replace mutable deletes with immutable update<commit_after>'use strict';

var React = require('react/addons');
var cx = React.addons.classSet;
var update = React.addons.update;
var zip = require('annozip');


module.exports = React.createClass({
    render() {
        var header = this.props.header || {};
        var data = this.props.data || [];
        var columns = this.props.columns || [];

        var props = update(this.props, {
            $merge: {
                header: undefined,
                data: undefined,
                columns: undefined,
            },
        });

        return (
            <table {...props}>
                <thead>
                    <tr>
                        {columns.map((column, i) => {
                            var z = zip(header);
                            var columnHeader = z && zip.toObject(z.map((pair) => {
                                if(pair[0].indexOf('on') === 0) {
                                    return [pair[0], pair[1].bind(null, column)];
                                }

                                return pair;
                            }));

                            return <th
                                key={i + '-header'}
                                className={cx(column.classes)}
                                {...columnHeader}
                            >
                                {column.header}
                            </th>;
                        })}
                    </tr>
                </thead>
                <tbody>
                    {data.map((row, i) => <tr key={i + '-row'}>{
                        columns.map((column, j) => {
                            var value = row[column.property];
                            var cell = column.cell;

                            if(cell) {
                                var props = cell(column.property, value, i, j);
                                var content = props.value;

                                props = update(props, {
                                    $merge: {
                                        value: undefined,
                                    },
                                });

                                return <td key={j + '-cell'} {...props}>{content}</td>
                            }
                            else {
{'fraction_non_alphanumeric': 0.11529933481152993, 'fraction_numerical': 0.0017738359201773836, 'mean_word_length': 0.7477721813250678, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1720838', 'n_tokens_mistral': 1054, 'n_tokens_neox': 974, 'n_words': 215}