<commit_before>module PyramidScheme
  class IndexClient
    attr_reader :index_provider
    def initialize(options = {})
      @index_provider = PyramidScheme::IndexProvider::FileSystem.new
    end

    def retrieve_index
      @index_provider.retrieve_index
      bounce_pids
    end

    def searchd_pids
      ps_output = `ps ax | grep searchd`
      ps_output.split("\n").collect{|p| /^(\d*)/.match(p)[0]}
    end

    def bounce_pids
      searchd_pids.each do |pid|
        Process.kill("HUP", pid.to_i) if pid != ""
      end
    end

  end
end
<commit_msg>handle for spaces leading the ps output<commit_after>module PyramidScheme
  class IndexClient
    attr_reader :index_provider
    def initialize(options = {})
      @index_provider = PyramidScheme::IndexProvider::FileSystem.new
    end

    def retrieve_index
      @index_provider.retrieve_index
      bounce_pids
    end

    def searchd_pids
      ps_output = `ps ax | grep searchd`
      ps_output.split("\n").collect{|p| /^\s*(\d*)/.match(p)[1]}
    end

    def bounce_pids
      searchd_pids.each do |pid|
        Process.kill("HUP", pid.to_i) if pid != ""
      end
    end

  end
end

{'fraction_non_alphanumeric': 0.10371650821089023, 'fraction_numerical': 0.001728608470181504, 'mean_word_length': 2.7115384615384617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4606619', 'n_tokens_mistral': 395, 'n_tokens_neox': 384, 'n_words': 84}