<commit_before>module Mutations
  class ArrayFilter < InputFilter
    def self.register_additional_filter(type_class, type_name)
      define_method(type_name) do | *args |
        options = args[0] || {}
        @element_filter = type_class.new(options)
      end
    end

    @default_options = {
      :nils => false,            # true allows an explicit nil to be valid. Overrides any other options
      :class => nil,             # A constant or string indicates that each element of the array needs to be one of these classes
      :arrayize => false,        # true will convert "hi" to ["hi"]. "" converts to []
      :discard_invalid => false  # true will strip invalid elements from our array
    }

    def initialize(name, opts = {}, &block)
      super(opts)

      @name = name
      @element_filter = nil

      if block_given?
        instance_eval &block
      end

      raise ArgumentError.new("Can't supply both a class and a filter") if @element_filter && self.options[:class]
    end
<commit_msg>don't need this array default now<commit_after>module Mutations
  class ArrayFilter < InputFilter
    def self.register_additional_filter(type_class, type_name)
      define_method(type_name) do | *args |
        options = args[0] || {}
        @element_filter = type_class.new(options)
      end
    end

    @default_options = {
      :nils => false,            # true allows an explicit nil to be valid. Overrides any other options
      :class => nil,             # A constant or string indicates that each element of the array needs to be one of these classes
      :arrayize => false         # true will convert "hi" to ["hi"]. "" converts to []
    }

    def initialize(name, opts = {}, &block)
      super(opts)

      @name = name
      @element_filter = nil

      if block_given?
        instance_eval &block
      end

      raise ArgumentError.new("Can't supply both a class and a filter") if @element_filter && self.options[:class]
    end

{'fraction_non_alphanumeric': 0.08819057273188038, 'fraction_numerical': 0.0010136847440446021, 'mean_word_length': 2.5, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '4527663', 'n_tokens_mistral': 552, 'n_tokens_neox': 534, 'n_words': 193}