<commit_before>const createHelper = (
  func,
  helperName,
  setDisplayName = true,
  noArgs = false
) => {
  if (process.env.NODE_ENV !== 'production' && setDisplayName) {
    const wrapDisplayName = require('./wrapDisplayName').default

    if (noArgs) {
      return BaseComponent => {
        const Component = func(BaseComponent)
        Component.displayName = wrapDisplayName(BaseComponent, helperName)
        return Component
      }
    }

    return (...args) => {
      if (process.env.NODE_ENV !== 'production' && args.length > func.length) {
        /* eslint-disable */
        console.error(
        /* eslint-enable */
          `Too many arguments passed to ${helperName}(). It should called ` +
          `like so: ${helperName}(...args)(BaseComponent).`
        )
      }

      return BaseComponent => {
        const Component = noArgs
          ? func(BaseComponent)
          : func(...args)(BaseComponent)

        Component.displayName = wrapDisplayName(BaseComponent, helperName)

        return Component
      }
    }
  }

  return func
}
<commit_msg>Clean up createHelper. (#157)<commit_after>const createHelper = (
  func,
  helperName,
  setDisplayName = true,
  noArgs = false
) => {
  if (process.env.NODE_ENV !== 'production' && setDisplayName) {
    const wrapDisplayName = require('./wrapDisplayName').default

    if (noArgs) {
      return BaseComponent => {
        const Component = func(BaseComponent)
        Component.displayName = wrapDisplayName(BaseComponent, helperName)
        return Component
      }
    }

    return (...args) => {
      if (args.length > func.length) {
        /* eslint-disable */
        console.error(
        /* eslint-enable */
          `Too many arguments passed to ${helperName}(). It should called ` +
          `like so: ${helperName}(...args)(BaseComponent).`
        )
      }

      return BaseComponent => {
        const Component = func(...args)(BaseComponent)
        Component.displayName = wrapDisplayName(BaseComponent, helperName)
        return Component
      }
    }
  }

  return func
}

{'fraction_non_alphanumeric': 0.12428023032629558, 'fraction_numerical': 0.0014395393474088292, 'mean_word_length': 2.293838862559242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4425912', 'n_tokens_mistral': 584, 'n_tokens_neox': 569, 'n_words': 125}