<commit_before>class XMLObject::CollectionProxy

  instance_methods.each do |m|
    meth_str, meth_sym = m.to_s, m.to_sym # Ruby 1.8 and 1.9 differ, so...

    undef_method meth_sym unless ( (meth_str =~ /^__/)        ||
                                   (meth_str =~ /^instance_/) ||
                                   (meth_sym == :extend)      ||
                                   (meth_sym == :object_id) )
  end

  def initialize(target_kid_key)
    @__children, @__attributes, @__target_kid = {}, {}, target_kid_key
  end

  private ##################################################################

  def method_missing(m, *a, &b) # :nodoc:
    dispatched = __question_dispatch(m, *a, &b)
    dispatched = __dot_notation_dispatch(m, *a, &b) if dispatched.nil?

    if dispatched.nil? && @__children[@__target_kid].respond_to?(m)
      dispatched = @__children[@__target_kid].__send__(m, *a, &b)

      unless dispatched.nil?
        # All is fair in Love and War. And 100% coverage.
        instance_eval \
          %{ def #{m}(*a, &b); @__children[@__target_kid].#{m}(*a, &b); end }
      end
    end

    dispatched.nil? ? raise(NameError.new(m.to_s)) : dispatched<commit_msg>Prevent the collection proxy from passing this to the question dispatcher<commit_after>class XMLObject::CollectionProxy

  instance_methods.each do |m|
    meth_str, meth_sym = m.to_s, m.to_sym # Ruby 1.8 and 1.9 differ, so...

    undef_method meth_sym unless ( (meth_str =~ /^__/)        ||
                                   (meth_str =~ /^instance_/) ||
                                   (meth_sym == :extend)      ||
                                   (meth_sym == :nil?)        ||
                                   (meth_sym == :object_id) )
  end

  def initialize(target_kid_key)
    @__children, @__attributes, @__target_kid = {}, {}, target_kid_key
  end

  private ##################################################################

  def method_missing(m, *a, &b) # :nodoc:
    dispatched = __question_dispatch(m, *a, &b)
    dispatched = __dot_notation_dispatch(m, *a, &b) if dispatched.nil?

    if dispatched.nil? && @__children[@__target_kid].respond_to?(m)
      dispatched = @__children[@__target_kid].__send__(m, *a, &b)

      unless dispatched.nil?
        # All is fair in Love and War. And 100% coverage.
        instance_eval \
          %{ def #{m}(*a, &b); @__children[@__target_kid].#{m}(*a, &b); end }
      end
    end

    dispatched.nil? ? raise(NameError.new(m.to_s)) : dispatched
{'fraction_non_alphanumeric': 0.18218138234119058, 'fraction_numerical': 0.005593288054334798, 'mean_word_length': 2.370121130551817, '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': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4421038', 'n_tokens_mistral': 858, 'n_tokens_neox': 787, 'n_words': 171}