<commit_before>class EventLogger::CaughtException
  include Mongoid::Document
  embedded_in :event, class_name: "EventLogger::Event"

  field :class_name, type: String
  field :message, type: String
  field :backtrace, type: Array

  def initialize(attrs_or_exception = nil)
    if attrs_or_exception.kind_of?(Exception)
      source_exception = attrs_or_exception.dup
      attrs = {
        class_name: source_exception.class.name,
        message: source_exception.message,
        backtrace: source_exception.backtrace
      }
      super(attrs)
    else
      super
    end
  end

  def to_s
    [class_name, message].join(" ")
  end
end<commit_msg>module nesting<commit_after>module EventLogger
  class CaughtException
    include Mongoid::Document
    embedded_in :event, class_name: "EventLogger::Event"

    field :class_name, type: String
    field :message, type: String
    field :backtrace, type: Array

    def initialize(attrs_or_exception = nil)
      if attrs_or_exception.kind_of?(Exception)
        source_exception = attrs_or_exception.dup
        attrs = {
          class_name: source_exception.class.name,
          message: source_exception.message,
          backtrace: source_exception.backtrace
        }
        super(attrs)
      else
        super
      end
    end

    def to_s
      [class_name, message].join(" ")
    end
  end
end
{'fraction_non_alphanumeric': 0.07765567765567766, 'fraction_numerical': 0.0, 'mean_word_length': 2.936599423631124, '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': '6122745', 'n_tokens_mistral': 404, 'n_tokens_neox': 402, 'n_words': 93}