<commit_before>module CB
  module Models
    class CollapsedJobResults
      attr_reader :args_hash, :total_count, :last_item_index, :search_location, :grouped_jobs, :grouping_parameter
      def initialize(args_hash)
        @args_hash = args_hash
        @total_count = args_hash['TotalCount']
        @last_item_index = args_hash['LastItemIndex']
        @search_location = args_hash['SearchMetaData']['SearchLocations']['SearchLocation'] rescue nil
        @grouping_parameter = args_hash['GroupedJobSearchResults']['GroupingParameter']
        @grouped_jobs = extract_collapsed_jobs(args_hash['GroupedJobSearchResults']['SearchResults'])
      end

      private

      def extract_collapsed_jobs(collapsed_jobs)
        collapsed_jobs.collect do |collapsed_job|
          collapsed_job.collect do |job_hash|
            Job.new(job_hash)
          end
        end
      end

    end
  end
end<commit_msg>moving things to make more sense<commit_after>module CB
  module Models
    class CollapsedJobResults
      attr_reader :args_hash, :total_count, :last_item_index, :search_location, :grouped_jobs, :grouping_parameter
      def initialize(args_hash)
        @args_hash = args_hash
        @total_count = args_hash['TotalCount']
        @last_item_index = args_hash['LastItemIndex']
        @search_location = args_hash['SearchMetaData']['SearchLocations']['SearchLocation'] rescue nil
        @grouping_parameter = args_hash['GroupedJobSearchResults']['GroupingParameter']
        @grouped_jobs = extract_collapsed_jobs(args_hash['GroupedJobSearchResults']['SearchResults'])
      end

      private

      def extract_collapsed_jobs(collapsed_jobs)
        collapsed_jobs.collect do |collapsed_job|
          CollapsedJobs.new(job_hash)
        end
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.08449916060436485, 'fraction_numerical': 0.0, 'mean_word_length': 3.6929133858267718, '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': '6956481', 'n_tokens_mistral': 528, 'n_tokens_neox': 511, 'n_words': 92}