<commit_before>module Helper
  DEFAULT_REPOS    = ['causes']
  DEFAULT_SRC_PATH = '..'
  GITHUB_ROOT      = '<EMAIL>:causes'
  GERRIT_REMOTE    = 'gerrit(.|.causes.com)?:29418'

  HOOKS   = Dir['hooks/*'].map { |path| path.split('/').last }
  SCRIPTS = 'scripts/'

  HOOKS_PATH = '.git/hooks/'

  def error(str)
    puts "\033[31m#{str}\033[0m"
  end

  def success(str)
    puts "\033[32m#{str}\033[0m"
  end

  def all_repos
    Dir["#{source_dir}*"].map do |dir|
      next unless File.directory? dir
      `cd #{dir} &&
       (git remote -v 2> /dev/null) |
         grep origin |
         egrep '#{GITHUB_ROOT}|#{GERRIT_REMOTE}'`
      dir.split('/').last if $?.success?
    end.compact
  end

  def copy_hooks(repo, options = {})<commit_msg>Teach install script about git://git remote<commit_after>module Helper
  DEFAULT_REPOS    = ['causes']
  DEFAULT_SRC_PATH = '..'
  CAUSES_REMOTES   = %w[
    <EMAIL>:causes
    git://git
    gerrit(.|.causes.com)?:29418
  ].join '|'


  HOOKS   = Dir['hooks/*'].map { |path| path.split('/').last }
  SCRIPTS = 'scripts/'

  HOOKS_PATH = '.git/hooks/'

  def error(str)
    puts "\033[31m#{str}\033[0m"
  end

  def success(str)
    puts "\033[32m#{str}\033[0m"
  end

  def all_repos
    Dir["#{source_dir}*"].map do |dir|
      next unless File.directory? dir
      `cd #{dir} &&
       (git remote -v 2> /dev/null) |
         grep origin |
         egrep '#{CAUSES_REMOTES}'`
      dir.split('/').last if $?.success?
    end.compact
  end

  def copy_hooks(repo, options = {})
{'fraction_non_alphanumeric': 0.18098360655737705, 'fraction_numerical': 0.031475409836065574, 'mean_word_length': 2.5821596244131455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7333469', 'n_tokens_mistral': 642, 'n_tokens_neox': 605, 'n_words': 117}