<commit_before>module SourceCode

  class Method

    attr_reader :source_location

    def initialize source_location
      @source_location = source_location
    end

    def file
      source_location[0]
    end

    def first_line
      source_location[1] - 1
    end

    def lines
      @lines ||= File.read(file).lines
    end

    def last_line
      indentation = indentation_on first_line

      index = first_line + 1
      while indentation != indentation_on(index)
        index += 1
      end
      index + 1
    end

    def indentation_on line_number
      lines[line_number].length - lines[line_number].lstrip.length
    end

    def source_code
      lines[first_line...last_line].join
    end

  end

end
<commit_msg>We only care about the source code.<commit_after>module SourceCode

  class Method

    attr_reader :source_location

    def initialize source_location
      @source_location = source_location
    end

    def source_code
      lines[first_line...last_line].join
    end

    private

    def file
      source_location[0]
    end

    def first_line
      source_location[1] - 1
    end

    def lines
      @lines ||= File.read(file).lines
    end

    def last_line
      indentation = indentation_on first_line

      index = first_line + 1
      while indentation != indentation_on(index)
        index += 1
      end
      index + 1
    end

    def indentation_on line_number
      lines[line_number].length - lines[line_number].lstrip.length
    end

  end

end

{'fraction_non_alphanumeric': 0.0577305905773059, 'fraction_numerical': 0.007962840079628402, 'mean_word_length': 2.236051502145923, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2818541', 'n_tokens_mistral': 473, 'n_tokens_neox': 441, 'n_words': 117}