<commit_before><?php
  function get_win_score($json, $team) {
  }
  
  function get_lose_score($json, $team) {
  }
  
  function get_support_score($json, $team) {
  }
<commit_msg>Initial scoring functions<commit_after><?php
  
  function get_win_score($json, $team) {
    $data = current(json_decode($json, TRUE));
    
    // determine whether we are home or away, return the score.
    if ($data['home']['abbr'] == $team) {
      return $data['home']['score']['T'];
    }
    return $data['away']['score']['T'];
  }
  
  function get_lose_score($json, $team) {
    $data = current(json_decode($json, TRUE));
    $score = 0;
    
    foreach ($data['scrsummary'] as $key => $value) {
      if ($value['type'] == 'TD' && $value['team'] == $team) {
        $score += 7;
      }
    }
    
    return $score;
  }
  
  function get_support_score($json, $team) {
    $data = current(json_decode($json, TRUE));
    $score = 0;
    
    foreach ($data['scrsummary'] as $key => $value) {
      if ($value['team'] == $team) {
        if ($value['type'] == 'FG') {
          // field goal
          $score += 3;
          continue;
        }
        if ($value['type'] == 'TD' && !strpos($value['desc'], 'failed')) {
          // PAT successful
          $score += 1;
          continue;
        }
      }
    }
    
    return $score;
  }

{'fraction_non_alphanumeric': 0.19158527422990232, 'fraction_numerical': 0.003756574004507889, 'mean_word_length': 2.305210918114144, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2697663', 'n_tokens_mistral': 454, 'n_tokens_neox': 448, 'n_words': 94}