<commit_before>import React, { Component, PropTypes } from 'react';
import { columnsConfig as columnsConfigPropType, filterConfigSingle as filterConfigSinglePropType, globalConfig as globalConfigPropType } from './proptypes';

class ToolbarDefault extends Component {
    constructor(props) {
        super(props);
    }

    render(){
        const {columnKeys, config, columns, filter } = this.props;
        const Filter = config.filter;

        const filters = columnKeys.map((currentColumnKey) => {
            let renderFilter = true;
            if(columns
            && columns[currentColumnKey]
            && columns[currentColumnKey].hideTools){
                renderFilter = false;
            }
            if(renderFilter){
                const filterObject = filter.filter((obj) => obj.columnName === currentColumnKey)[0];
                const query = filterObject ? filterObject.expression : '';
                return(
                <th key={currentColumnKey}>
                    <Filter config={config} column={currentColumnKey} query={query} />
                </th>
            );}
            else {return(<th key={currentColumnKey}></th>);}
        });

        return(
            <tr>
                {filters}
            </tr>
        );
    }
}

if (process.env.NODE_ENV !== 'production'){
    ToolbarDefault.propTypes = {
        config : globalConfigPropType,
        columnKeys: PropTypes.arrayOf(PropTypes.string).isRequired,
        columns: columnsConfigPropType,
        filter: PropTypes.arrayOf(filterConfigSinglePropType).isRequired
    };
}
export default ToolbarDefault;<commit_msg>Formatting fixes<commit_after>import React, { Component, PropTypes } from 'react';
import { columnsConfig as columnsConfigPropType, filterConfigSingle as filterConfigSinglePropType, globalConfig as globalConfigPropType } from './proptypes';

class ToolbarDefault extends Component {
    constructor(props) {
        super(props);
    }

    render(){
        const {columnKeys, config, columns, filter } = this.props;
        const Filter = config.filter;

        const filters = columnKeys.map((currentColumnKey) => {
            let renderFilter = true;
            if(columns
            && columns[currentColumnKey]
            && columns[currentColumnKey].hideTools){
                renderFilter = false;
            }
            if(renderFilter){
                const filterObject = filter.filter((obj) => obj.columnName === currentColumnKey)[0];
                const query = filterObject ? filterObject.expression : '';
                return(
                    <th key={currentColumnKey}>
                        <Filter config={config} column={currentColumnKey} query={query} />
                    </th>
                );
            }
            else {return(<th key={currentColumnKey}></th>);}
        });

        return(
            <tr>
                {filters}
            </tr>
        );
    }
}

if (process.env.NODE_ENV !== 'production'){
    ToolbarDefault.propTypes = {
        config : globalConfigPropType,
        columnKeys: PropTypes.arrayOf(PropTypes.string).isRequired,
        columns: columnsConfigPropType,
        filter: PropTypes.arrayOf(filterConfigSinglePropType).isRequired
    };
}
export default ToolbarDefault;

{'fraction_non_alphanumeric': 0.10695837131570951, 'fraction_numerical': 0.0006077180188392585, 'mean_word_length': 2.123339658444023, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, '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': '5733250', 'n_tokens_mistral': 826, 'n_tokens_neox': 806, 'n_words': 170}