<commit_before>class Integer

  def p_times(priority=:default, &block)
    queue = Dispatch::Queue.concurrent(priority)
    queue.apply(self, &block)
  end

end

module Enumerable

  def p_each(priority=nil, &block)
    ary = self.to_a
    ary.size.p_times(priority) do |i| 
      block.call(ary[i])
    end
    self
  end

  def p_each_index(priority=nil, &block)
    ary = self.to_a
    ary.size.p_times(priority) do |i|
      block.call(i)
    end
    self
  end

  def p_each_with_index(priority=nil, &block)
    ary = self.to_a
    ary.size.p_times(priority) do |i|
      block.call(ary[i], i)
    end
    self
  end

  def p_map(priority=nil, &block)
    ary = self.to_a
    @p_map_result = Array.new(ary.size)
    ary.p_each_with_index(priority) do |obj, i|
      @p_map_result[i] = block.call(obj)
    end
    @p_map_result
  end
  alias :p_collect :p_map

end<commit_msg>get rid of instance variable<commit_after>class Integer

  def p_times(priority=:default, &block)
    queue = Dispatch::Queue.concurrent(priority)
    queue.apply(self, &block)
  end

end

module Enumerable

  def p_each(priority=nil, &block)
    ary = self.to_a
    ary.size.p_times(priority) do |i| 
      block.call(ary[i])
    end
    self
  end

  def p_each_index(priority=nil, &block)
    ary = self.to_a
    ary.size.p_times(priority) do |i|
      block.call(i)
    end
    self
  end

  def p_each_with_index(priority=nil, &block)
    ary = self.to_a
    ary.size.p_times(priority) do |i|
      block.call(ary[i], i)
    end
    self
  end

  def p_map(priority=nil, &block)
    ary = self.to_a
    result = Array.new(ary.size)
    ary.p_each_with_index(priority) do |obj, i|
      result[i] = block.call(obj)
    end
    result
  end
  alias :p_collect :p_map

end
{'fraction_non_alphanumeric': 0.1145952109464082, 'fraction_numerical': 0.0, 'mean_word_length': 2.840262582056893, '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': '1042577', 'n_tokens_mistral': 712, 'n_tokens_neox': 681, 'n_words': 143}