<commit_before>import React, { PropTypes } from 'react';
import { observer } from 'mobx-react';
import { browserHistory } from 'react-router';

import UserContext from './Layout/UserContext';
import Menu from './Layout/Menu';

@observer
class Layout extends React.Component {
  constructor() {
    super();

    this.state = {
      enlarged: false,
      showSearch: false,
      searchValue: "",
      searchCallback: null
    };

    browserHistory.listen((location) => {
      this.setState({ showSearch: false });
    });
  }

  getChildContext() {
    return {
      toggleSearch: this.toggleSearch.bind(this),
      searchValue: this.state.searchValue
    };
  }

  toggleEnlargedMode() {
    this.setState({ enlarged: !this.state.enlarged });
  }

  toggleSearch(callback) {
    this.setState({
      showSearch: !this.state.showSearch,
      searchCallback: callback
    });
  }

  handleSearchChange(event) {
    this.setState({ searchValue: event.target.value });
    this.state.searchCallback(event.target.value);
  }

  render() {
    let searchField;

    if (this.state.showSearch) {
      searchField = (<input type="text" className="header__search"
        placeholder="Filter..."
        value={this.state.searchValue}
        onChange={this.handleSearchChange.bind(this)} />)
    }

    return (
      <div className={this.state.enlarged ? 'enlarged' : ''}>
        <header>
          <Menu />
          {searchField}
          <div className="header__toolbar">
            <a onClick={this.toggleEnlargedMode.bind(this)} className="header__toolbar__enlarge" />
            <UserContext /><commit_msg>Fixed linting (for build)<commit_after>import React, { PropTypes } from 'react';
import { observer } from 'mobx-react';
import { browserHistory } from 'react-router';

import UserContext from './Layout/UserContext';
import Menu from './Layout/Menu';

@observer
class Layout extends React.Component {
  constructor() {
    super();

    this.state = {
      enlarged: false,
      showSearch: false,
      searchValue: "",
      searchCallback: null
    };

    browserHistory.listen(() => {
      this.setState({ showSearch: false });
    });
  }

  getChildContext() {
    return {
      toggleSearch: this.toggleSearch.bind(this),
      searchValue: this.state.searchValue
    };
  }

  toggleEnlargedMode() {
    this.setState({ enlarged: !this.state.enlarged });
  }

  toggleSearch(callback) {
    this.setState({
      showSearch: !this.state.showSearch,
      searchCallback: callback
    });
  }

  handleSearchChange(event) {
    this.setState({ searchValue: event.target.value });
    this.state.searchCallback(event.target.value);
  }

  render() {
    let searchField;

    if (this.state.showSearch) {
      searchField = (<input type="text" className="header__search"
        placeholder="Filter..."
        value={this.state.searchValue}
        onChange={this.handleSearchChange.bind(this)} />);
    }

    return (
      <div className={this.state.enlarged ? 'enlarged' : ''}>
        <header>
          <Menu />
          {searchField}
          <div className="header__toolbar">
            <a onClick={this.toggleEnlargedMode.bind(this)} className="header__toolbar__enlarge" />
            <UserContext />
{'fraction_non_alphanumeric': 0.13775038520801233, 'fraction_numerical': 0.0, 'mean_word_length': 2.827830188679245, 'pattern_counts': {'":': 0, '<': 17, '<?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': '3709980', 'n_tokens_mistral': 958, 'n_tokens_neox': 943, 'n_words': 175}