<commit_before>const Immutable = require('immutable');
const elo = require('elo-rank')();

const DEFAULT_ELO = 1100;

const getNewElos = (winners, losers) => {
  var newElos = {};
  const totalWinnerElo = winners.reduce((sum, winner) => sum + winner.elo, 0);
  const totalLoserElo = winners.reduce((sum, loser) => sum + loser.elo, 0);
  const expectedWinnerElo = elo.getExpected(totalWinnerElo, totalLoserElo);
  const expectedLoserElo = elo.getExpected(totalLoserElo, totalWinnerElo);
  const winnersAdjustedElo = elo.updateRating(expectedWinnerElo, 1, totalWinnerElo);
  const losersAdjustedElo = elo.updateRating(expectedLoserElo, 0, totalLoserElo);

  if (winners.length === 1 && losers.length === 1) {
    newElos[winners[0].playerId] = winnersAdjustedElo;
    newElos[losers[0].playerId] = losersAdjustedElo;
  } else {
    winners.forEach((winner) => {
      const gainRatio = (totalWinnerElo - winner.elo) / totalWinnerElo;
      const totalGain = winnersAdjustedElo - totalWinnerElo;
      newElos[winner.playerId] = winner.elo + (totalGain * gainRatio);
    });

    losers.forEach((loser) => {
      const gainRatio = (totalLoserElo - loser.elo) / totalLoserElo;
      const totalGain = losersAdjustedElo - totalLoserElo;
      newElos[loser.playerId] = loser.elo + (totalGain * gainRatio);
    });<commit_msg>changed my mind, changing default back to 1000<commit_after>const Immutable = require('immutable');
const elo = require('elo-rank')();

const DEFAULT_ELO = 1000;

const getNewElos = (winners, losers) => {
  var newElos = {};
  const totalWinnerElo = winners.reduce((sum, winner) => sum + winner.elo, 0);
  const totalLoserElo = winners.reduce((sum, loser) => sum + loser.elo, 0);
  const expectedWinnerElo = elo.getExpected(totalWinnerElo, totalLoserElo);
  const expectedLoserElo = elo.getExpected(totalLoserElo, totalWinnerElo);
  const winnersAdjustedElo = elo.updateRating(expectedWinnerElo, 1, totalWinnerElo);
  const losersAdjustedElo = elo.updateRating(expectedLoserElo, 0, totalLoserElo);

  if (winners.length === 1 && losers.length === 1) {
    newElos[winners[0].playerId] = winnersAdjustedElo;
    newElos[losers[0].playerId] = losersAdjustedElo;
  } else {
    winners.forEach((winner) => {
      const gainRatio = (totalWinnerElo - winner.elo) / totalWinnerElo;
      const totalGain = winnersAdjustedElo - totalWinnerElo;
      newElos[winner.playerId] = winner.elo + (totalGain * gainRatio);
    });

    losers.forEach((loser) => {
      const gainRatio = (totalLoserElo - loser.elo) / totalLoserElo;
      const totalGain = losersAdjustedElo - totalLoserElo;
      newElos[loser.playerId] = loser.elo + (totalGain * gainRatio);
    });
{'fraction_non_alphanumeric': 0.12897196261682242, 'fraction_numerical': 0.010467289719626169, 'mean_word_length': 4.461224489795918, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '746104', 'n_tokens_mistral': 973, 'n_tokens_neox': 936, 'n_words': 177}