(year, month, day)
Return the scoreboard information for games matching the parameters
        as a dictionary.
Return the scoreboard information for games matching the parameters
        as a dictionary.
Return the scoreboard information for games matching the parameters as a dictionary .
def scoreboard(year, month, day):
    """
        Return the scoreboard information for games matching the parameters
        as a dictionary.
    """
    data = nhl_api.data.get_schedule(year, month, day)
    if not data:
        return data
    parsed = data.json()

    if parsed["dates"]:
        games_data = parsed["dates"][0]["games"]
        games = {}
        for game in games_data:
            game_id = game['gamePk']
            season = game['season']
            game_type = game['gameType']
            game_date = game['gameDate']

            home_team_id = int(game['teams']['home']['team']['id'])
            home_team_name = game['teams']['home']['team']['name']
            away_team_id = int(game['teams']['away']['team']['id'])
            away_team_name = game['teams']['away']['team']['name']
            home_score = game['teams']['home']['score']
            away_score = game['teams']['away']['score']

            status = game['status']['detailedState']
            status_code = game['status']['statusCode']
            status_abstract_state = game['status']['abstractGameState']
            linescore = game['linescore']

            output = {
                'game_id': game_id,
                'season': season,
                'game_type': game_type,
                'game_date': game_date,
                'home_team_id': home_team_id,
                'home_team_name': home_team_name,
                'away_team_id': away_team_id,
                'away_team_name': away_team_name,
                'home_score': home_score,
                'away_score': away_score,
                'status': status,
                'status_code': status_code,
                'status_abstract_state': status_abstract_state,
                # All the linescore information (goals, sog, periods etc...)
                'linescore': linescore,
            }

            # put this dictionary into the larger dictionary
            games[game_id] = output
        return games
    else:
        return []
def scoreboard ( year , month , day ) : data = nhl_api . data . get_schedule ( year , month , day ) if not data : return data parsed = data . json ( ) if parsed [ "dates" ] : games_data = parsed [ "dates" ] [ 0 ] [ "games" ] games = { } for game in games_data : game_id = game [ 'gamePk' ] season = game [ 'season' ] game_type = game [ 'gameType' ] game_date = game [ 'gameDate' ] home_team_id = int ( game [ 'teams' ] [ 'home' ] [ 'team' ] [ 'id' ] ) home_team_name = game [ 'teams' ] [ 'home' ] [ 'team' ] [ 'name' ] away_team_id = int ( game [ 'teams' ] [ 'away' ] [ 'team' ] [ 'id' ] ) away_team_name = game [ 'teams' ] [ 'away' ] [ 'team' ] [ 'name' ] home_score = game [ 'teams' ] [ 'home' ] [ 'score' ] away_score = game [ 'teams' ] [ 'away' ] [ 'score' ] status = game [ 'status' ] [ 'detailedState' ] status_code = game [ 'status' ] [ 'statusCode' ] status_abstract_state = game [ 'status' ] [ 'abstractGameState' ] linescore = game [ 'linescore' ] output = { 'game_id' : game_id , 'season' : season , 'game_type' : game_type , 'game_date' : game_date , 'home_team_id' : home_team_id , 'home_team_name' : home_team_name , 'away_team_id' : away_team_id , 'away_team_name' : away_team_name , 'home_score' : home_score , 'away_score' : away_score , 'status' : status , 'status_code' : status_code , 'status_abstract_state' : status_abstract_state , # All the linescore information (goals, sog, periods etc...) 'linescore' : linescore , } # put this dictionary into the larger dictionary games [ game_id ] = output return games else : return [ ]