<commit_before>class Fight < ActiveRecord::Base
  belongs_to :blue_champion, class_name: 'Champion'
  belongs_to :red_champion, class_name: 'Champion'

  def update_champions
    red_champion.total_bets  += bets_red
    blue_champion.total_bets += bets_blue

    red_change           = EloUtil::compute_score(red_champion.elo, blue_champion.elo)
    blue_change          = EloUtil::compute_score(blue_champion.elo, red_champion.elo)
    red_k = EloUtil::compute_k(red_champion)
    blue_k = EloUtil::compute_k(blue_champion)

    if winner == 1
      red_champion.wins    += 1
      blue_champion.losses += 1
      red_champion.elo     = red_k * (1-red_change)
      blue_champion.elo    = blue_k * (0-blue_change)
    else
      red_champion.losses     += 1
      blue_champion.wins      += 1
      red_champion.elo        = red_k * (0-red_change)
      blue_champion.elo       = blue_k * (1-blue_change)
    end

    red_champion.save
    blue_champion.save
  end

end

<commit_msg>+= is not the samea s =<commit_after>class Fight < ActiveRecord::Base
  belongs_to :blue_champion, class_name: 'Champion'
  belongs_to :red_champion, class_name: 'Champion'

  def update_champions
    red_champion.total_bets  += bets_red
    blue_champion.total_bets += bets_blue

    red_change  = EloUtil::compute_score(red_champion.elo, blue_champion.elo)
    blue_change = EloUtil::compute_score(blue_champion.elo, red_champion.elo)
    red_k       = EloUtil::compute_k(red_champion)
    blue_k      = EloUtil::compute_k(blue_champion)

    if winner == 1
      red_champion.wins    += 1
      blue_champion.losses += 1
      red_champion.elo     += red_k * (1-red_change)
      blue_champion.elo    += blue_k * (0-blue_change)
    else
      red_champion.losses += 1
      blue_champion.wins  += 1
      red_champion.elo    += red_k * (0-red_change)
      blue_champion.elo   += blue_k * (1-blue_change)
    end

    red_champion.save
    blue_champion.save
  end

end


{'fraction_non_alphanumeric': 0.09341500765696784, 'fraction_numerical': 0.009188361408882083, 'mean_word_length': 2.983739837398374, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1831833', 'n_tokens_mistral': 738, 'n_tokens_neox': 762, 'n_words': 118}