Returns an array of all pitchers who have started at least one game during the specified season
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
911417
def init_pitcher_from_scoreboard(element)
      @first = element.attributes['first']
      @last = element.attributes['last']
      @wins = element.attributes['wins']
      @losses = element.attributes['losses']
      @era = element.attributes['era']
    end
1131268
def get_injuries_by_team(self, season, week, team_id):
        
        result = self._method_call("Injuries/{season}/{week}/{team_id}", "stats", season=season, week=week, team_id=team_id)
        return result
618949
def at_bats_count
      gameday_info = GamedayUtil.parse_gameday_id(@gid)
      appearances = get_all_appearances(gameday_info["year"])
      count = appearances.inject(0) {|sum, a| sum + a.ab.to_i }    
    end
1233210
public function GetTeamInfoByTeamIDV1($start_at_team_id = null, $teams_requested = null)
    {
        return $this->_call(__METHOD__, 'GET', array('start_at_team_id' => $start_at_team_id, 'teams_requested' => $teams_requested));
    }
427394
def _generate_object(cls, soup, game, players):
        

        def get_batter(soup, team_flag):
            batting = soup.find('batting', attrs={'team_flag': team_flag})
            if batting:
                return batting.find_all('batter')
            return []

        def get_pitcher(soup, team_flag):
            pitching = soup.find('pitching', attrs={'team_flag': team_flag})
            if pitching:
                return pitching.find_all('pitcher')
            return []

        box_score = BoxScore(game, players)

        box_score.retro_game_id = game.retro_game_id
        box_score.home_team_id = game.home_team_id
        box_score.away_team_id = game.away_team_id
        box_score.home_batting = [box_score._get_batter(b) for b in get_batter(soup, 'home')]
        box_score.away_batting = [box_score._get_batter(b) for b in get_batter(soup, 'away')]
        box_score.home_pitching = [box_score._get_pitcher(p) for p in get_pitcher(soup, 'home')]
        box_score.away_pitching = [box_score._get_pitcher(p) for p in get_pitcher(soup, 'away')]

        return box_score
182960
def started_during(self, year, month):
		""""""
		return self.exclude(status="trialing").filter(start__year=year, start__month=month)
209725
def get_standings(date):
    """"""
    try:
        return urlopen(STANDINGS_URL.format(date.year,
                                            date.strftime('%Y/%m/%d')))
    except HTTPError:
        ValueError('Could not find the standings file. '
                   'mlb.com does not provide the file that '
                   'mlbgame needs to perform this operation.')
738692
def team_stats(game_id):
    
    # get data from data module
    box_score = mlbgame.data.get_box_score(game_id)
    raw_box_score = mlbgame.data.get_raw_box_score(game_id)
    # parse XML
    box_score_tree = etree.parse(box_score).getroot()
    raw_box_score_tree = etree.parse(raw_box_score).getroot()
    # get pitching and batting ingo
    pitching = box_score_tree.findall('pitching')
    batting = box_score_tree.findall('batting')
    # dictionary for output
    output = {}
    output = __team_stats_info(pitching, output, 'pitching')
    output = __team_stats_info(batting, output, 'batting')
    output = __raw_team_stats_info(raw_box_score_tree, output)
    return output
338811
def get_match_history(start_at_match_id=None, player_name=None, hero_id=None,
                      skill=0, date_min=None, date_max=None, account_id=None,
                      league_id=None, matches_requested=None, game_mode=None,
                      min_players=None, tournament_games_only=None,
                      **kwargs):
    

    params = {
        "start_at_match_id": start_at_match_id,
        "player_name": player_name,
        "hero_id": hero_id,
        "skill": skill,
        "date_min": date_min,
        "date_max": date_max,
        "account_id": account_id,
        "league_id": league_id,
        "matches_requested": matches_requested,
        "game_mode": game_mode,
        "min_players": min_players,
        "tournament_games_only": tournament_games_only
    }

    return make_request("GetMatchHistory", params, **kwargs)
422638
function getPlayerCounters(player, attacker, game) {
  return player.hand
    .map((card) => {
      return card.validCounters ? card.validCounters(player, attacker, game) : []
    })
    .reduce((acc, array) => {
      return acc.concat(array)
    }, [])
    .sort((counterA, counterB) => counterB.weight - counterA.weight)
}
53716
def get_cleanup_hitters_unique(year)
      hitters = get_cleanup_hitters_by_year(year)
      h = {}
      hitters.each {|hitter| h[hitter.batter_name]=hitter}
      h.values
    end
783570
def __get_league_object():
    """"""
    # get data
    data = mlbgame.data.get_properties()
    # return league object
    return etree.parse(data).getroot().find('leagues').find('league')
408018
public List<String> getPlayerNames() {
        return lastGameState.getPlayers().stream().map(Player::getUsername).collect(Collectors.toList());
    }
1111772
def _download(self, timestamp):
        
        games, atbats, pitches = [], [], []
        rosters, coaches, umpires = [], [], []
        boxscores, actions = [], []
        timestamp_params = {
            'year': str(timestamp.year),
            'month': str(timestamp.month).zfill(2),
            'day': str(timestamp.day).zfill(2)
        }

        logging.info('->- Game data download start({year}/{month}/{day})'.format(**timestamp_params))

        base_url = self.DELIMITER.join([self.url, self.PAGE_URL_GAME_DAY.format(**timestamp_params)])
        html = MlbamUtil.find_xml(base_url, self.parser)

        href = self.PAGE_URL_GAME_PREFIX.format(**timestamp_params)
        for gid in html.find_all('a', href=re.compile(href)):
            gid_path = gid.get_text().strip()
            gid_url = self.DELIMITER.join([base_url, gid_path])
            # Read XML & create dataset
            try:
                game = Game.read_xml(gid_url, self.parser, timestamp, MlbAm._get_game_number(gid_path))
                players = Players.read_xml(gid_url, self.parser, game)
                innings = Inning.read_xml(gid_url, self.parser, game, players)
                boxscore = BoxScore.read_xml(gid_url, self.parser, game, players)
            except MlbAmHttpNotFound as e:
                logging.warning(e.msg)
                continue

            # append a dataset
            games.append(game.row())
            rosters.extend([roseter.row() for roseter in players.rosters.values()])
            coaches.extend([coach.row() for coach in players.coaches.values()])
            umpires.extend([umpire.row() for umpire in players.umpires.values()])
            atbats.extend(innings.atbats)
            pitches.extend(innings.pitches)
            actions.extend(innings.actions)
            boxscores.append(boxscore.row())

        # writing csv
        day = "".join([timestamp_params['year'], timestamp_params['month'], timestamp_params['day']])
        for params in (
                {'datasets': games, 'filename': Game.DOWNLOAD_FILE_NAME},
                {'datasets': rosters, 'filename': Players.Player.DOWNLOAD_FILE_NAME},
                {'datasets': coaches, 'filename': Players.Coach.DOWNLOAD_FILE_NAME},
                {'datasets': umpires, 'filename': Players.Umpire.DOWNLOAD_FILE_NAME},
                {'datasets': atbats, 'filename': AtBat.DOWNLOAD_FILE_NAME},
                {'datasets': pitches, 'filename': Pitch.DOWNLOAD_FILE_NAME},
                {'datasets': boxscores, 'filename': BoxScore.DOWNLOAD_FILE_NAME},
                {'datasets': actions, 'filename': InningAction.DOWNLOAD_FILE_NAME},
        ):
            self._write_csv(params['datasets'], params['filename'].format(day=day, extension=self.extension))
        time.sleep(2)

        logging.info('-<- Game data download end({year}/{month}/{day})'.format(**timestamp_params))
499028
def get_injuries(self, season, week):
        
        result = self._method_call("Injuries/{season}/{week}", "stats", season=season, week=week)
        return result