<commit_before>module Chimp

  #
  # Factory
  #
  class ExecutionGroupFactory
    def self.from_type(type)
      if type == :serial
        return SerialExecutionGroup.new(nil)
      elsif type == :parallel
        return ParallelExecutionGroup.new(nil)
      else
        raise "invalid execution group type specified"
      end
    end
  end

  #
  # An ExecutionGroup contains a set of Executors to be processed
  #
  # Only the subclasses SerialExecutionGroup and ParallelExecutionGroup
  # should be used directly.
  #
  class ExecutionGroup
    attr_accessor :group_id, :description, :concurrency
    attr_reader   :time_start, :time_end

    def initialize(new_group_id=nil)
      @group_id = new_group_id
      @queue = []
      @jobs_by_id = {}
      @log = nil
      @time_start = nil
      @time_end = nil
      @concurrency = 1
    end

    # TODO - Create a to_json method
    def to_h()
      return {"foo" => "bar"}
    end
    #
    # Add something to the work queue
    #
    def push(j)
      raise "invalid work" if j == nil
      j.job_id = IDManager.get if j.job_id == nil
      j.group = self
      @queue.push(j)
      @jobs_by_id[j.job_id] = j<commit_msg>Added ability to request data for a single job_uuid<commit_after>module Chimp

  #
  # Factory
  #
  class ExecutionGroupFactory
    def self.from_type(type)
      if type == :serial
        return SerialExecutionGroup.new(nil)
      elsif type == :parallel
        return ParallelExecutionGroup.new(nil)
      else
        raise "invalid execution group type specified"
      end
    end
  end

  #
  # An ExecutionGroup contains a set of Executors to be processed
  #
  # Only the subclasses SerialExecutionGroup and ParallelExecutionGroup
  # should be used directly.
  #
  class ExecutionGroup
    attr_accessor :group_id, :description, :concurrency
    attr_reader   :time_start, :time_end

    def initialize(new_group_id=nil)
      @group_id = new_group_id
      @queue = []
      @jobs_by_id = {}
      @log = nil
      @time_start = nil
      @time_end = nil
      @concurrency = 1
    end

    #
    # Add something to the work queue
    #
    def push(j)
      raise "invalid work" if j == nil
      j.job_id = IDManager.get if j.job_id == nil
      j.group = self
      @queue.push(j)
      @jobs_by_id[j.job_id] = j
{'fraction_non_alphanumeric': 0.07885615251299827, 'fraction_numerical': 0.0008665511265164644, 'mean_word_length': 2.3658892128279883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '512051', 'n_tokens_mistral': 744, 'n_tokens_neox': 729, 'n_words': 208}