<commit_before>class GitData

  attr_reader :full_name, :html_url, :name

  def self.create(username, repo_name, options = {})
    client = options[:client]
    # Create repo that auto initializes
    repo = client.create_repository(repo_name.parameterize, auto_init: true)
    full_name = full_name(username, repo_name)
    # Get the current branch info
    branch_data = client.branch full_name, 'master'
    # Create a gh-pages branch
    client.create_ref(full_name, 'heads/gh-pages', branch_data.commit.sha)
    # Make the gh-pages branch the default
    client.edit_repository(full_name, default_branch: 'gh-pages')
    new(client, repo)
  end

  def self.find(username, repo_name, options = {})
    client = options[:client]
    repo = client.repository(full_name(username, repo_name))
    new(client, repo, true)
  end

  def self.full_name(username, repo_name)
    "#{username}/#{repo_name.parameterize}"
  end

  def initialize(client, repo, build_base = false)
    @client, @repo = client, repo
    @full_name = @repo.full_name
    @html_url = @repo.html_url
    @name = @repo.name
    if build_base === true
      tree = tree_data(base_tree)
      tree.each { |t| append_to_tree(t[:path], t[:sha]) if t[:type] == 'blob' }
    end
  end

  def add_file(filename, file_contents)
    blob_sha = blob_sha(file_contents)
    append_to_tree(filename, blob_sha)
  end

  def update_file(filename, file_contents)<commit_msg>Parameterize the username too<commit_after>class GitData

  attr_reader :full_name, :html_url, :name

  def self.create(username, repo_name, options = {})
    client = options[:client]
    # Create repo that auto initializes
    repo = client.create_repository(repo_name.parameterize, auto_init: true)
    full_name = full_name(username, repo_name)
    # Get the current branch info
    branch_data = client.branch full_name, 'master'
    # Create a gh-pages branch
    client.create_ref(full_name, 'heads/gh-pages', branch_data.commit.sha)
    # Make the gh-pages branch the default
    client.edit_repository(full_name, default_branch: 'gh-pages')
    new(client, repo)
  end

  def self.find(username, repo_name, options = {})
    client = options[:client]
    repo = client.repository(full_name(username, repo_name))
    new(client, repo, true)
  end

  def self.full_name(username, repo_name)
    "#{username.parameterize}/#{repo_name.parameterize}"
  end

  def initialize(client, repo, build_base = false)
    @client, @repo = client, repo
    @full_name = @repo.full_name
    @html_url = @repo.html_url
    @name = @repo.name
    if build_base === true
      tree = tree_data(base_tree)
      tree.each { |t| append_to_tree(t[:path], t[:sha]) if t[:type] == 'blob' }
    end
  end

  def add_file(filename, file_contents)
    blob_sha = blob_sha(file_contents)
    append_to_tree(filename, blob_sha)
  end

  def update_file(filename, file_contents)
{'fraction_non_alphanumeric': 0.11265164644714037, 'fraction_numerical': 0.0, 'mean_word_length': 3.9165247018739353, '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': '7171482', 'n_tokens_mistral': 960, 'n_tokens_neox': 948, 'n_words': 222}