def count_prev_games(home_team, away_team, date): ''' count_prev_games: returns the number of previous games played by each team. Used to check history criteria. ''' return min(utilities.count_prev_games(home_team.dates, date), utilities.count_prev_games(away_team.dates, date))
def count_prev_games(home_team, away_team, date): ''' count_prev_games: returns the number of previous games played by each team. Used to check history criteria. ''' return min(utilities.count_prev_games(home_team.dates, date), utilities.count_prev_games(away_team.dates, date))
def player_history_met(player, date, min_games): # count number of history games for current player game_count = utilities.count_prev_games(player.dates, date) shot_count = utilities.count_prev_games(player.shots_dates, date) return (min(game_count, shot_count) >= min_games)
def player_history_met(player, date, min_games): # count number of history games for current player game_count = utilities.count_prev_games(player.dates, date) shot_count = utilities.count_prev_games(player.shots_dates, date) return (min(game_count, shot_count) >= min_games)