<commit_before>module Validators
  module Validator
    def errors
      @errors ||= []
    end

    def add_error(msg, options = {})
      add_issue(msg, :error, options)
    end

    def add_warning(msg, options = {})
      add_issue(msg, :warning, options)
    end

    def add_issue(msg, msg_type, options = {})
      attributes = { message: msg, msg_type: msg_type,
                     validator_type: self.class.validator_type }.merge(options)
      @errors ||= []
      @errors << ExecutionError.new(attributes)
    end

    def add_errors(errors)
      self.errors.concat errors
    end

    def self.included(receiver)
      receiver.send :mattr_accessor, :validator_type
    end
  end
end<commit_msg>reference object as top-level to prevent module error<commit_after>module Validators
  module Validator
    def errors
      @errors ||= []
    end

    def add_error(msg, options = {})
      add_issue(msg, :error, options)
    end

    def add_warning(msg, options = {})
      add_issue(msg, :warning, options)
    end

    def add_issue(msg, msg_type, options = {})
      attributes = { message: msg, msg_type: msg_type,
                     validator_type: self.class.validator_type }.merge(options)
      @errors ||= []
      @errors << ::ExecutionError.new(attributes)
    end

    def add_errors(errors)
      self.errors.concat errors
    end

    def self.included(receiver)
      receiver.send :mattr_accessor, :validator_type
    end
  end
end
{'fraction_non_alphanumeric': 0.10314207650273224, 'fraction_numerical': 0.0, 'mean_word_length': 2.635235732009926, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1851280', 'n_tokens_mistral': 456, 'n_tokens_neox': 453, 'n_words': 108}