<commit_before>import React from 'react'
import debounce from 'lodash/debounce'

const searchFor = debounce(term => window.routerHistory.push(`/search/${term}`), 500)

export default class SearchBox extends React.Component {
  static defaultProps = {
    className: '',
    placeholder: 'Search...',
    term: '',
  }

  constructor(props) {
    super(props)
    this.state = { term: props.term }
  }
  componentDidMount() { window.addEventListener('keyup', this.onKeyUp) }
  componentWillReceiveProps(props) {
    if (props.term !== this.state.term) this.setState({ term: props.term })
  }
  componentWillUnmount() { window.removeEventListener('keyup', this.onKeyUp) }

  onKeyUp = (e) => {
    if (e.ctrlKey && e.shiftKey && e.code === 'KeyF') {
      e.preventDefault()
      e.stopPropagation()
      this.input.focus()
    }
  }

  createRef = (input) => { this.input = input }
  render() {
    const { className, placeholder } = this.props
    return (
      <div className={`search-box ${className}`}><commit_msg>Add hotkey info to placeholder text<commit_after>import React from 'react'
import debounce from 'lodash/debounce'

const searchFor = debounce(term => window.routerHistory.push(`/search/${term}`), 500)

export default class SearchBox extends React.Component {
  static defaultProps = {
    className: '',
    placeholder: 'Search... (Ctrl+Shift+F)',
    term: '',
  }

  constructor(props) {
    super(props)
    this.state = { term: props.term }
  }
  componentDidMount() { window.addEventListener('keyup', this.onKeyUp) }
  componentWillReceiveProps(props) {
    if (props.term !== this.state.term) this.setState({ term: props.term })
  }
  componentWillUnmount() { window.removeEventListener('keyup', this.onKeyUp) }

  onKeyUp = (e) => {
    if (e.ctrlKey && e.shiftKey && e.code === 'KeyF') {
      e.preventDefault()
      e.stopPropagation()
      this.input.focus()
    }
  }

  createRef = (input) => { this.input = input }
  render() {
    const { className, placeholder } = this.props
    return (
      <div className={`search-box ${className}`}>
{'fraction_non_alphanumeric': 0.15599422243620606, 'fraction_numerical': 0.002888781896966779, 'mean_word_length': 3.488120950323974, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '5371369', 'n_tokens_mistral': 661, 'n_tokens_neox': 654, 'n_words': 137}