<commit_before>class Repo < ActiveRecord::Base
    has_many :branches
    has_many :team_projects
    has_many :users, through: :team_projects
    has_many :commits, through: :branches

    validates :name, presence: true
    before_save :make_display_name

  def find_collisions
    files = []
    self.commits.each do |commit|
      files << commit.path_names
    end
    collisions = files.detect{ |change| files.count(change) > 1}
  end

  def make_display_name
    self.display_name = self.name.chomp('.git').reverse.split("").take_while{|c| c != '/'}.join("").reverse
  end

  def show
    @user = current_user
    @repo = Repo.find(params[:id])
    @repo_commits = heat_map(r@epo.commits)
    branches = @repo.branches
    @non_user_branches = branches.where.not(user_id: @user.id)
    @user_branches = branches.where(user_id: @user.id)

    if @repo.branches.length > 0
      @collisions = branches.first.@repo.find_collisions
    else
      @collisions = []
    end 
  end
  
end<commit_msg>fix typo to push<commit_after>class Repo < ActiveRecord::Base
    has_many :branches
    has_many :team_projects
    has_many :users, through: :team_projects
    has_many :commits, through: :branches

    validates :name, presence: true
    before_save :make_display_name

  def find_collisions
    files = []
    self.commits.each do |commit|
      files << commit.path_names
    end
    collisions = files.detect{ |change| files.count(change) > 1}
  end

  def make_display_name
    self.display_name = self.name.chomp('.git').reverse.split("").take_while{|c| c != '/'}.join("").reverse
  end

  def show
    @user = current_user
    @repo = Repo.find(params[:id])
    @repo_commits = heat_map(@repo.commits)
    branches = @repo.branches
    @non_user_branches = branches.where.not(user_id: @user.id)
    @user_branches = branches.where(user_id: @user.id)

    if @repo.branches.length > 0
      @collisions = branches.first.@repo.find_collisions
    else
      @collisions = []
    end 
  end
  
end
{'fraction_non_alphanumeric': 0.12081877184223665, 'fraction_numerical': 0.00199700449326011, 'mean_word_length': 3.2638297872340427, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '762362', 'n_tokens_mistral': 700, 'n_tokens_neox': 683, 'n_words': 140}