<commit_before>module Hawk
  module Model

    class Collection < Array
      include Kaminari::PageScopeMethods if defined? ::Kaminari

      def initialize(elements = [], http_options={})
        self.replace(elements)
        @total_count = http_options[:total_count]
        @limit_value = http_options[:limit]
        @offset_value = http_options[:offset]
      end

      attr_reader :total_count, :limit_value, :offset_value

      def inspect
        "#<#{self.class.name} count:#{total_count} contents:#{super}>"
      end

      def count
        total_count || super
      end

      def map(&block)
        self.class.new(super, @total_count)
      end
    end

  end
end
<commit_msg>Fix map()<commit_after>module Hawk
  module Model

    class Collection < Array
      include Kaminari::PageScopeMethods if defined? ::Kaminari

      def initialize(elements = [], http_options={})
        self.replace(elements)
        @total_count = http_options[:total_count]
        @limit_value = http_options[:limit]
        @offset_value = http_options[:offset]
      end

      attr_reader :total_count, :limit_value, :offset_value

      def inspect
        "#<#{self.class.name} count:#{total_count} contents:#{super}>"
      end

      def count
        total_count || super
      end

      def map(&block)
        self.class.new(super, total_count: @total_count, limit: @limit_value, offset: @offset_value)
      end
    end

  end
end

{'fraction_non_alphanumeric': 0.10311418685121107, 'fraction_numerical': 0.0, 'mean_word_length': 2.6793893129770994, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '1656338', 'n_tokens_mistral': 437, 'n_tokens_neox': 424, 'n_words': 98}