<commit_before>import React, {Component, PropTypes} from 'react';
import {compose} from 'redux';
import {connect} from 'react-redux';
import InputText from 'focus-components/input-text';
import InputSelect from 'focus-components/select-mdl';

import {selectSearch} from '../reducer';

export function SearchBarInput({queryAction}) {
    return <InputText data-focus='search-bar-input' name='search-bar-input' onChange={(value) => queryAction({term : value})} />
};
SearchBarInput.propTypes= {
    query: PropTypes.func
};
const SearchBarInputConnected =SearchBarInput;




export function SearchBarScopeSelection({scope, scopes, scopeAction}) {
    return (
        <InputSelect data-focus='search-bar-scope-selection'
            hasUndefined={false} values={scopes}
            valueKey='value'
            rawInputValue={scope || 'ALL'}
            name='search-scope'
            onChange={
                (value) => value === 'ALL' ?
                scopeAction({group: {value:  {}, replace: false}, query:{value: {scope: undefined}, replace: false}})
                :
                scopeAction({query: {value :{scope: value}, replace: false}, group: {value: {}, replace: true}})
            }
            />
    );
};
SearchBarScopeSelection.propTypes = {
    scope: PropTypes.string,
    scopes: PropTypes.array.isRequired,
    scopeFunction: PropTypes.func
};
SearchBarScopeSelection.defaultProps = {
    scopes: []
};
const SearchBarScopeSelectionConnected = SearchBarScopeSelection;



export function SearchBar({queryAction, scopes, scope, scopeAction}) {
    return (
        <div data-focus='search-bar'>
            <SearchBarScopeSelectionConnected
                scopeAction={scopeAction} scopes={scopes} scope={scope} />
            <SearchBarInputConnected queryAction={queryAction}/>
        </div>
    );
};
SearchBar.PropTypes ={
    query: PropTypes.func,
    group: PropTypes.func
};<commit_msg>format code<commit_after>import React, {Component, PropTypes} from 'react';
import {compose} from 'redux';
import {connect} from 'react-redux';
import InputText from 'focus-components/input-text';
import InputSelect from 'focus-components/select-mdl';

import {selectSearch} from '../reducer';

export function SearchBarInput({queryAction}) {
    return <InputText data-focus='search-bar-input' name='search-bar-input' onChange={(value) => queryAction({term : value})} />
};
SearchBarInput.propTypes= {
    query: PropTypes.func
};
const SearchBarInputConnected = SearchBarInput;



export function SearchBarScopeSelection({scope, scopes, scopeAction}) {
    return (
        <InputSelect data-focus='search-bar-scope-selection'
            hasUndefined={false} values={scopes}
            valueKey='value'
            rawInputValue={scope || 'ALL'}
            name='search-scope'
            onChange={
                (value) => value === 'ALL' ?
                scopeAction({group: {value: {}, replace: false}, query: {value: {scope: undefined}, replace: false}})
                :
                scopeAction({query: {value: {scope: value}, replace: false}, group: {value: {}, replace: true}})
            } />
    );
};
SearchBarScopeSelection.propTypes = {
    scope: PropTypes.string,
    scopes: PropTypes.array.isRequired,
    scopeFunction: PropTypes.func
};
SearchBarScopeSelection.defaultProps = {
    scopes: []
};
const SearchBarScopeSelectionConnected = SearchBarScopeSelection;



export function SearchBar({queryAction, scopes, scope, scopeAction}) {
    return (
        <div data-focus='search-bar'>
            <SearchBarScopeSelectionConnected
                scopeAction={scopeAction}
                scopes={scopes}
                scope={scope} />
            <SearchBarInputConnected queryAction={queryAction} />
        </div>
    );
};
SearchBar.PropTypes = {
    query: PropTypes.func,
    group: PropTypes.func
};
{'fraction_non_alphanumeric': 0.13347128815312986, 'fraction_numerical': 0.0, 'mean_word_length': 3.1491416309012874, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, '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': '2856276', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1055, 'n_words': 226}