<commit_before># (see Ruby::MethodHandler)
class YARD::Handlers::Ruby::Legacy::MethodHandler < YARD::Handlers::Ruby::Legacy::Base
  handles TkDEF

  process do
    nobj = namespace
    mscope = scope

    if statement.tokens.to_s =~ /^def\s+(#{METHODMATCH})(?:(?:\s+|\s*\()(.*)(?:\)\s*$)?)?/m
      meth, args = $1, $2
      meth.gsub!(/\s+/,'')
      args = tokval_list(YARD::Parser::Ruby::Legacy::TokenList.new(args), :all)
      args.map! {|a| k, v = *a.split('=', 2); [k.strip, (v ? v.strip : nil)] } if args
    else
      raise YARD::Parser::UndocumentableError, "method: invalid name"
    end

    # Class method if prefixed by self(::|.) or Module(::|.)
    if meth =~ /(?:#{NSEPQ}|#{CSEPQ})([^#{NSEP}#{CSEPQ}]+)$/
      mscope, meth, prefix = :class, $1, $`
      if prefix =~ /^[a-z]/ && prefix != "self"
        raise YARD::Parser::UndocumentableError, 'method defined on object instance'<commit_msg>Fix broken keyword arg test for legacy parser<commit_after># (see Ruby::MethodHandler)
class YARD::Handlers::Ruby::Legacy::MethodHandler < YARD::Handlers::Ruby::Legacy::Base
  handles TkDEF

  process do
    nobj = namespace
    mscope = scope

    if statement.tokens.to_s =~ /^def\s+(#{METHODMATCH})(?:(?:\s+|\s*\()(.*)(?:\)\s*$)?)?/m
      meth, args = $1, $2
      meth.gsub!(/\s+/,'')
      args = tokval_list(YARD::Parser::Ruby::Legacy::TokenList.new(args), :all)
      args.map! do |a|
        k, v, r = *a.split(/(:)|=/, 2)
        if r
          k += v
          v = r
        end
        [k.strip, (v ? v.strip : nil)]
      end if args
    else
      raise YARD::Parser::UndocumentableError, "method: invalid name"
    end

    # Class method if prefixed by self(::|.) or Module(::|.)
    if meth =~ /(?:#{NSEPQ}|#{CSEPQ})([^#{NSEP}#{CSEPQ}]+)$/
      mscope, meth, prefix = :class, $1, $`
      if prefix =~ /^[a-z]/ && prefix != "self"
        raise YARD::Parser::UndocumentableError, 'method defined on object instance'
{'fraction_non_alphanumeric': 0.21656378600823045, 'fraction_numerical': 0.00411522633744856, 'mean_word_length': 3.0605427974947808, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5620985', 'n_tokens_mistral': 737, 'n_tokens_neox': 721, 'n_words': 160}