<commit_before>class Navbar extends React.Component {
  constructor(props, context) {
    super(props, context);

    this.state = { showSpinner: false };
  }

  render() {
    return (
      <div className="row">
        <div className="col-md-4">
          <div className="navbar-header">
            <a className="navbar-brand">
              <div className="navbar-spinner">
                <svg
                  className={this.getSpinnerCssClass()}
                  viewBox="0 0 66 66"
                  xmlns="http://www.w3.org/2000/svg">
                  <circle
                    className="path"
                    fill="none"
                    strokeWidth="6"
                    strokeLinecap="round"
                    cx="33"
                    cy="33"
                    r="30"></circle>
                </svg>

                <img
                  src="<%= asset_path 'logo-donkeywhite.png' %>"
                  className={this.getLogoCssClass()} />
              </div>

              <span className="navbar-brand-title">Mykonote</span>
            </a>
            <button
              data-target=".notes-list"
              data-toggle="collapse"
              className="navbar-toggle navbar-hamburger-button" type="button">
              <span className="icon-bar"></span>
              <span className="icon-bar"></span>
              <span className="icon-bar"></span>
            </button>
            <button
              data-target=".search-bar"
              data-toggle="collapse"
              className="navbar-toggle navbar-search-button" type="button">
              <i className="material-icons">search</i>
            </button>
          </div>
          <div className="navbar-form navbar-right search-bar collapse in-sm">
            <div className="form-group">
              <input
                type="text"
                className="string optional form-control"
                placeholder="Search"
                onChange={this.props.handleSearchEnter} />
            </div>
          </div>
        </div>
      </div>
    );
  }

  componentDidMount() {
    // listen on global event so we can toggle the spinner from unrelated
    // components
    $(document).on('mykonote.spinner', (e, data) => {
      this.setState({ showSpinner: data });
    });
  }

  componentWillUnmount() {
    $(document).off('mykonote.spinner');
  }<commit_msg>focus search field when expanded<commit_after>class Navbar extends React.Component {
  constructor(props, context) {
    super(props, context);

    this.state = { showSpinner: false };
  }

  render() {
    return (
      <div className="row">
        <div className="col-md-4">
          <div className="navbar-header">
            <a className="navbar-brand">
              <div className="navbar-spinner">
                <svg
                  className={this.getSpinnerCssClass()}
                  viewBox="0 0 66 66"
                  xmlns="http://www.w3.org/2000/svg">
                  <circle
                    className="path"
                    fill="none"
                    strokeWidth="6"
                    strokeLinecap="round"
                    cx="33"
                    cy="33"
                    r="30"></circle>
                </svg>

                <img
                  src="<%= asset_path 'logo-donkeywhite.png' %>"
                  className={this.getLogoCssClass()} />
              </div>

              <span className="navbar-brand-title">Mykonote</span>
            </a>
            <button
              data-target=".notes-list"
              data-toggle="collapse"
              className="navbar-toggle navbar-hamburger-button" type="button">
              <span className="icon-bar"></span>
              <span className="icon-bar"></span>
              <span className="icon-bar"></span>
            </button>
            <button
              data-target=".search-bar"
              data-toggle="collapse"
              className="navbar-toggle navbar-search-button" type="button">
              <i className="material-icons">search</i>
            </button>
          </div>
          <div
            className="navbar-form navbar-right search-bar collapse in-sm"
            ref={(c) => {
              $(c).off('shown.bs.collapse').on('shown.bs.collapse', () => {
                this.$searchInput.focus();
              });
            }}>
            <div className="form-group">
              <input
                type="text"
                className="string optional form-control"
                placeholder="Search"
                onChange={this.props.handleSearchEnter}
                ref={(c) => this.$searchInput = $(c)} />
            </div>
          </div>
        </div>
      </div>
    );
  }

  componentDidMount() {
    // listen on global event so we can toggle the spinner from unrelated
    // components
    $(document).on('mykonote.spinner', (e, data) => {
      this.setState({ showSpinner: data });
    });
  }

  componentWillUnmount() {
    $(document).off('mykonote.spinner');
  }
{'fraction_non_alphanumeric': 0.13773399014778326, 'fraction_numerical': 0.00748768472906404, 'mean_word_length': 1.4114014251781473, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 78, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '1211536', 'n_tokens_mistral': 1394, 'n_tokens_neox': 1298, 'n_words': 234}