<commit_before>var getTargetNameById = function (stack, needle) {
  var ret = '';
  stack.forEach(function (element) {
    if (element.id == needle) {
      ret =  element.name;
      return;
    }
  });

  return ret;
};

var getSummonerNameById = function (stack, needle) {
  return stack[needle].summonerName;
};

module.exports = function (rawData, proPlayers, proTeams, leagueData) {
  var targetName = getTargetNameById(rawData.targetType == 'team' ? proTeams : proPlayers, rawData.targetId);
  var summonerName = getSummonerNameById(leagueData.fantasyTeams, rawData.fantasyTeamId);

  return (summonerName + (rawData.addition ? ' ADD ' : ' DROP ') + targetName);

};<commit_msg>add team name for player<commit_after>var getTargetNameById = function (stack, needle) {
  var ret = '';
  stack.forEach(function (element) {
    if (element.id == needle) {
      ret =  element.name;
      return;
    }
  });

  return ret;
};

var getTargetTeamIdById = function (stack, needle) {
  var ret = '';
  stack.forEach(function (element) {
    if (element.id == needle) {
      ret =  element.proTeamId;
      return;
    }
  });

  return ret;
};

var getSummonerNameById = function (stack, needle) {
  return stack[needle].summonerName;
};

module.exports = function (rawData, proPlayers, proTeams, leagueData) {
  var targetName = getTargetNameById(rawData.targetType == 'team' ? proTeams : proPlayers, rawData.targetId);
  var summonerName = getSummonerNameById(leagueData.fantasyTeams, rawData.fantasyTeamId);

  if (rawData.targetType == 'player') {
    targetName += ' - ' + getTargetNameById(proTeams, getTargetTeamIdById(proPlayers, rawData.targetId));
  }

  return (summonerName + (rawData.addition ? ' ADD ' : ' DROP ') + targetName);

};
{'fraction_non_alphanumeric': 0.1327990841442473, 'fraction_numerical': 0.0, 'mean_word_length': 3.994285714285714, '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': '96370', 'n_tokens_mistral': 592, 'n_tokens_neox': 572, 'n_words': 122}