<commit_before>def skel(klass)
  ret = ""
  ret << "class #{klass}"
  ret << "< #{klass.superclass}" if klass.superclass != Object
  ret << "\n"
  ret << "  extend RDL\n"
  klass.methods(false).each do |m|
    ret << "  CLASS METHOD: typesig(:#{m})\n"
  end
  klass.instance_methods(false).each do |m|
    ps = (klass.instance_method m).parameters
    ret << "  typesig(:#{m}, \"("
    first = true
    block = false
    ps.each { |kind, name|
        name = "XXXX" unless name
        if kind == :req then
          ret << ", " unless first
          first = false
          ret << "#{name} : XXXX"
        elsif kind == :opt then
          ret << ", " unless first
          first = false
          ret << "#{name} : ?XXXX"
        elsif kind == :args or kind == :rest then
          ret << ", " unless first
          first = false
          ret << "#{name} : *XXXX"
        elsif kind == :block then
          block = true
        else
          puts "ERROR! Don't know what #{kind}, #{name} means"
        end
    }
    if block then
      ret << ") { BLOCK }\")\n"
    else
      ret << ")\")\n"
    end
  end
  ret << "end\n"
end

require "set"

puts skel(Set)
<commit_msg>check for module vs. class<commit_after>def skel(klass)
  ret = ""
  
  if klass.instance_of? Class then
    ret << "class #{klass}"
    ret << "< #{klass.superclass}" if klass.superclass != Object
  elsif klass.instance_of? Module then
    ret << "module #{klass}"
  end
  ret << "\n"
  ret << "  extend RDL\n"
  klass.methods(false).each do |m|
    ret << "  CLASS METHOD: typesig(:#{m})\n"
  end
  klass.instance_methods(false).each do |m|
    ps = (klass.instance_method m).parameters
    ret << "  typesig(:#{m}, \"("
    first = true
    block = false
    ps.each { |kind, name|
        name = "XXXX" unless name
        if kind == :req then
          ret << ", " unless first
          first = false
          ret << "#{name} : XXXX"
        elsif kind == :opt then
          ret << ", " unless first
          first = false
          ret << "#{name} : ?XXXX"
        elsif kind == :args or kind == :rest then
          ret << ", " unless first
          first = false
          ret << "#{name} : *XXXX"
        elsif kind == :block then
          block = true
        else
          puts "ERROR! Don't know what #{kind}, #{name} means"
        end
    }
    if block then
      ret << ") { BLOCK }\")\n"
    else
      ret << ")\")\n"
    end
  end
  ret << "end\n"
end

require "set"

puts skel(Set)

{'fraction_non_alphanumeric': 0.15749296906388108, 'fraction_numerical': 0.0, 'mean_word_length': 1.797752808988764, 'pattern_counts': {'":': 0, '<': 67, '<?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': '3546916', 'n_tokens_mistral': 813, 'n_tokens_neox': 825, 'n_words': 248}