<commit_before>module Byebug
  class Context
    class << self
      IGNORED_XML_FILES = Dir.glob(File.expand_path('../../../**/*.rb', __FILE__))

      def ignored_with_xml(path)
        ignored_without_xml(path) || IGNORED_XML_FILES.include?(path)
      end

      alias_method :ignored_without_xml, :ignored
      alias_method :ignored, :ignored_with_xml
    end
  end
end<commit_msg>Monkeypatch Context.stack_size calculation<commit_after>module Byebug
  class Context
    class << self
      IGNORED_XML_FILES = Dir.glob(File.expand_path('../../../**/*', __FILE__))

      def stack_size(byebug_frames = false)
        backtrace = Thread.current.backtrace_locations(0)
        return 0 unless backtrace

        unless byebug_frames
          backtrace = backtrace.select { |l| !ignored(l.path) }
        end
        backtrace.size
      end

      def ignored_with_xml(path)
        result = ignored_without_xml(path) ||
          IGNORED_XML_FILES.include?(path) ||
          !!path.match(/^\(eval\)/) ||
          !!path.match(/rdebug-vim$/) ||
          !!path.match(/rdebug-ide$/)
        result
      end

      alias_method :ignored_without_xml, :ignored
      alias_method :ignored, :ignored_with_xml
    end
  end
end
{'fraction_non_alphanumeric': 0.11860276198212835, 'fraction_numerical': 0.0016246953696181965, 'mean_word_length': 2.5504322766570606, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '1276490', 'n_tokens_mistral': 408, 'n_tokens_neox': 397, 'n_words': 70}