<commit_before>class String
  def indent(spaces=2)
    return self.undent(-spaces) if spaces < 0

    lines = self.split $/
    lines.each do |line|
      if line.blank?
        line.clear
      else
        line.insert(0, ' '*spaces)
      end
    end
    lines.join $/
  end

  def blank?
    !!match(/^\s+$/)
  end

  def undent(spaces=2)
    return self.indent(-spaces) if spaces < 0

    lines = self.split $/
    lines.each do |line|
      line.slice!(0...spaces)
    end
    lines.join $/
  end

  def demodulize!
    gsub! /^.*::/, ''
  end

  def demodulize
    dup.demodulize!
  end

  def underscore!
    gsub! /::/, '/'
    gsub! /([A-Z]+)([A-Z][a-z])/, '\1_\2'
    gsub! /([a-z\d])([A-Z])/, '\1_\2'
    tr!   '-', '_'
    downcase!
    self
  end

  def underscore
    dup.underscore!
  end

  def camelcase
    #TODO
  end

  def lchomp!(ch=$/)
    if self.starts_with? ch
      slice!(0...(ch.length))
    end
    self
  end

  def lchomp(ch=$/)
    self.dup.lchomp!(ch)
  end

  def unchomp!(ch=$/)
    self.chomp!(ch)
    self << ch
    self
  end

  def unchomp(ch=$/)
    self.dup.unchomp!(ch)
  end
<commit_msg>String#camelize<commit_after>class String
  def indent(spaces=2)
    return self.undent(-spaces) if spaces < 0

    lines = self.split $/
    lines.each do |line|
      if line.blank?
        line.clear
      else
        line.insert(0, ' '*spaces)
      end
    end
    lines.join $/
  end

  def blank?
    !!match(/^\s+$/)
  end

  def undent(spaces=2)
    return self.indent(-spaces) if spaces < 0

    lines = self.split $/
    lines.each do |line|
      line.slice!(0...spaces)
    end
    lines.join $/
  end

  def demodulize!
    gsub! /^.*::/, ''
  end

  def demodulize
    dup.demodulize!
  end

  def underscore!
    gsub! /::/, '/'
    gsub! /([A-Z]+)([A-Z][a-z])/, '\1_\2'
    gsub! /([a-z\d])([A-Z])/, '\1_\2'
    tr!   '-', '_'
    downcase!
    self
  end

  def underscore
    dup.underscore!
  end

  def camelize!
    downcase!
    gsub! /\//, '::'
    gsub! /((^|_)\w)/ do |letter|
      letter[-1..-1].upcase
    end

    self
  end

  def camelize
    dup.camelize!
  end

  def lchomp!(ch=$/)
    if self.starts_with? ch
      slice!(0...(ch.length))
    end
    self
  end

  def lchomp(ch=$/)
    self.dup.lchomp!(ch)
  end

  def unchomp!(ch=$/)
    self.chomp!(ch)
    self << ch
    self
  end

  def unchomp(ch=$/)
    self.dup.unchomp!(ch)
  end

{'fraction_non_alphanumeric': 0.17310087173100872, 'fraction_numerical': 0.009962640099626401, 'mean_word_length': 1.808857808857809, 'pattern_counts': {'":': 0, '<': 11, '<?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': '5794243', 'n_tokens_mistral': 1025, 'n_tokens_neox': 975, 'n_words': 206}