<commit_before>module Draper
  class DecoratedEnumerableProxy
    include Enumerable

    def initialize(collection, klass, options = {})
      @wrapped_collection, @klass, @options = collection, klass, options
    end

    def each(&block)
      @wrapped_collection.each { |member| block.call(@klass.decorate(member, @options)) }
    end

    def to_ary
      @wrapped_collection.map { |member| @klass.decorate(member, @options) }
    end

    def method_missing (method, *args, &block)
      @wrapped_collection.send(method, *args, &block)
    end

    def respond_to?(method)
      super || @wrapped_collection.respond_to?(method)
    end
    
    def kind_of?(klass)
      @wrapped_collection.kind_of?(klass) || super(klass)
    end
    alias :is_a? :kind_of?

    def ==(other)
      @wrapped_collection == other
    end

    def [](index)
      @klass.new(@wrapped_collection[index], @options)
    end

    def to_s
      "#<DecoratedEnumerableProxy of #{@klass} for #{@wrapped_collection.inspect}>"
    end
  end
end
<commit_msg>Change code style to mimic ffa790138c2e85f631e89b2b35283eabb4bac984<commit_after>module Draper
  class DecoratedEnumerableProxy
    include Enumerable

    def initialize(collection, klass, options = {})
      @wrapped_collection, @klass, @options = collection, klass, options
    end

    def each(&block)
      @wrapped_collection.each { |member| block.call(@klass.decorate(member, @options)) }
    end

    def to_ary
      @wrapped_collection.map { |member| @klass.decorate(member, @options) }
    end

    def method_missing (method, *args, &block)
      @wrapped_collection.send(method, *args, &block)
    end

    def respond_to?(method)
      super || @wrapped_collection.respond_to?(method)
    end
    
    def kind_of?(klass)
      super || @wrapped_collection.kind_of?(klass)
    end
    alias :is_a? :kind_of?

    def ==(other)
      @wrapped_collection == other
    end

    def [](index)
      @klass.new(@wrapped_collection[index], @options)
    end

    def to_s
      "#<DecoratedEnumerableProxy of #{@klass} for #{@wrapped_collection.inspect}>"
    end
  end
end

{'fraction_non_alphanumeric': 0.11420481359131666, 'fraction_numerical': 0.011326097215667769, 'mean_word_length': 3.291497975708502, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1200975', 'n_tokens_mistral': 713, 'n_tokens_neox': 712, 'n_words': 151}