Returns an array of all pitchers who have closed at least one game during the specified season
421327
def get_closers_unique(year)
      pitchers = get_close_pitcher_appearances_by_year(year)
      h = {}
      pitchers.each {|pitcher| h[pitcher.pitcher_name]=pitcher}
      h.values
    end
247902
function notes (pitches, durations, params) {
  var p = toArray(pitches || null)
  var d = toArray(durations || 1)
  return p.map(function (pitch, i) {
    return score.note(+d[i % d.length], pitch, params)
  })
}
323131
def roster(team_id):
    """"""
    data = mlbgame.data.get_roster(team_id)
    parsed = json.loads(data.read().decode('utf-8'))
    players = parsed['roster_40']['queryResults']['row']
    return {'players': players, 'team_id': team_id}
1182153
def get_players_game_stats_for_season_for_week(self, season, week, season_type="REG"):
        
        try:
            season = int(season)
            week = int(week)
            if season_type not in ["REG", "PRE", "POST"]:
                raise ValueError
        except (TypeError, ValueError):
            raise FantasyDataError('Error: Invalid method parameters')

        season_param = "{0}{1}".format(season, season_type)
        result = self._method_call("PlayerGameStatsByWeek/{season}/{week}", "stats", season=season_param, week=week)
        return result
1116078
def _get_pitch(self, soup, pa):
        
        pitches = []
        ball_tally, strike_tally = 0, 0
        for pitch in soup.find_all('pitch'):
            # pitching result
            pitch = Pitch.row(pitch, pa, pitches, ball_tally, strike_tally)
            pitches.append(pitch)
            # ball count
            ball_tally, strike_tally = RetroSheet.ball_count(ball_tally, strike_tally, pitch['pitch_res'])
        return pitches
1083870
def load_from_id(gid)
      @gid = gid
      @rosters = []
      @umpires = {}
      @xml_data = GamedayFetcher.fetch_players(gid)
      @xml_doc = REXML::Document.new(@xml_data)
      if @xml_doc.root
        self.set_rosters
        self.set_umpires
      end
    end
811497
def quality_starts_count(year)
      count = 0
      games = all_games(year)
      games.each do |game|
        starters = game.get_starting_pitchers
        if game.home_team_abbrev == @abrev
          if starters[1].quality_start?
            count = count + 1
          end
        else
          if starters[0].quality_start?
            count = count + 1
          end
        end
      end
      count
    end
352565
def get_starters_unique(year)
      pitchers = get_start_pitcher_appearances_by_year(year)
      h = {}
      pitchers.each {|pitcher| h[pitcher.pitcher_name]=pitcher}
      h.values
    end
796941
def get_batters(home_or_away)
      if self.gid
        bs = get_boxscore
        if home_or_away == 'away'
        	bs.batters[0]
        else
          bs.batters[1]
        end
      else
        puts "No data for input specified"
      end
    end
534443
def get_leadoff_hitters_by_year(year)
      results = []
      games = all_games(year)
      games.each do |game|
        boxscore = game.get_boxscore
        leadoffs = boxscore.get_leadoff_hitters
        if game.home_team_abbrev == @abrev
          results << leadoffs[1]
        else
          results << leadoffs[0]
        end
      end
      results
    end
408018
public List<String> getPlayerNames() {
        return lastGameState.getPlayers().stream().map(Player::getUsername).collect(Collectors.toList());
    }
1347927
def result(cls, ab, pa, pitch_list):
        
        atbat = OrderedDict()
        atbat['ball_ct'] = MlbamUtil.get_attribute_stats(ab, 'b', int, None)
        atbat['strike_ct'] = MlbamUtil.get_attribute_stats(ab, 's', int, None)
        atbat['pitch_seq'] = ''.join([pitch['pitch_res'] for pitch in pitch_list])
        atbat['pitch_type_seq'] = '|'.join([pitch['pitch_type'] for pitch in pitch_list])
        atbat['battedball_cd'] = RetroSheet.battedball_cd(pa['event_cd'], pa['event_tx'], pa['ab_des'])
        return atbat
221235
public AggregatedStats getAggregatedStats(long id, GameMode gameMode, Season season) {
        return client.sendRpcAndWait(SERVICE, "getAggregatedStats", id, gameMode, season.numeric);
    }
1239214
def get_projected_player_game_stats_by_team(self, season, week, team_id):
        
        result = self._method_call("PlayerGameProjectionStatsByTeam/{season}/{week}/{team_id}", "projections", season=season, week=week, team_id=team_id)
        return result
118017
function players (resp) {
  return base(resp).map(function (player) {
    var names = player.displayLastCommaFirst.split(", ").reverse();
    return {
      firstName: names[0].trim(),
      lastName: (names[1] ? names[1] : "").trim(),
      playerId: player.personId,
      teamId: player.teamId,
    };
  });
}
769211
def load_from_scoreboard(element)
        @away_innings = []
        @home_innings = []
        @scoreboard_game_id = element.attributes['id']
        @ampm = element.attributes['ampm']
        @venue = element.attributes['venue']
        @game_pk = element.attributes['game_pk']
        @time = element.attributes['time']
        @time_zone = element.attributes['time_zone']
        @game_type = element.attributes['game_type']
        @away_name_abbrev = element.attributes['away_name_abbrev']
        @home_name_abbrev = element.attributes['home_name_abbrev']
        @away_code = element.attributes['away_code']
        @away_file_code = element.attributes['away_file_code']
        @away_team_id = element.attributes['away_team_id']
        @away_team_city = element.attributes['away_team_city']
        @away_team_name = element.attributes['away_team_name']
        @away_division = element.attributes['away_division']
        @home_code = element.attributes['home_code']
        @home_file_code = element.attributes['home_file_code']
        @home_team_id = element.attributes['home_team_id']
        @home_team_city = element.attributes['home_team_city']
        @home_team_name = element.attributes['home_team_name']
        @home_division = element.attributes['home_division']
        @day = element.attributes['day']
        @gameday_sw = element.attributes['gameday_sw']
        @away_games_back = element.attributes['away_games_back']
        @home_games_back = element.attributes['home_games_back']
        @away_games_back_wildcard = element.attributes['away_games_back_wildcard']
        @home_games_back_wildcard = element.attributes['home_games_back_wildcard']
        @venue_w_chan_loc = element.attributes['venue_w_chan_loc']
        @gameday = element.attributes['gameday']
        @away_win = element.attributes['away_win']
        @away_loss = element.attributes['away_loss']
        @home_win = element.attributes['home_win']
        @home_loss = element.attributes['home_loss']
        @league = element.attributes['league']
      
        set_status(element)
        set_innings(element)
        set_totals(element)
        set_pitchers(element)
        set_homeruns(element)
      end
670290
def broadcast_info(team_id, date=datetime.now()):
    """"""
    data = mlbgame.info.broadcast_info(team_id, date)
    return [mlbgame.info.BroadcastInfo(x) for x in data]