def __init__(self, data):
        """Creates a `GameScoreboard` object.

        data is expected to come from the `scoreboard()` function.
        """
        # go through dictionary and assign it to object properties
        self.game_id = data['game_id']
        self.game_type = data.get('game_type', '')
        self.game_status = data.get('game_status', '')
        self.game_league = data.get('game_league', '')
        self.game_start_time = data.get('game_start_time', '')
        self.home_team = data.get('home_team', {}).get('name', '')
        self.home_team_runs = data.get('home_team', {}).get('runs', 0)
        self.home_team_hits = data.get('home_team', {}).get('hits', 0)
        self.home_team_errors = data.get('home_team', {}).get('errors', 0)
        self.away_team = data.get('away_team', '').get('name', '')
        self.away_team_runs = data.get('away_team', {}).get('runs', 0)
        self.away_team_hits = data.get('away_team', {}).get('hits', 0)
        self.away_team_errors = data.get('away_team', {}).get('errors', 0)
        self.w_pitcher = data.get('w_pitcher', {}).get('name', '')
        self.w_pitcher_wins = data.get('w_pitcher', {}).get('wins', 0)
        self.w_pitcher_losses = data.get('w_pitcher', {}).get('losses', 0)
        self.l_pitcher = data.get('l_pitcher', {}).get('name', '')
        self.l_pitcher_wins = data.get('l_pitcher', {}).get('wins', 0)
        self.l_pitcher_losses = data.get('l_pitcher', {}).get('losses', 0)
        self.sv_pitcher = data.get('sv_pitcher', {}).get('name', '')
        self.sv_pitcher_saves = data.get('sv_pitcher', {}).get('saves', 0)
        self.w_team = ''
        self.l_team = ''
        # calculate the winning team
        if self.away_team_runs > self.home_team_runs:
            self.w_team = self.home_team
            self.l_team = self.away_team
        elif self.away_team_runs > self.home_team_runs:
            self.w_team = self.away_team
            self.l_team = self.home_team
        # create the datetime object for the game
        year, month, day, rest = self.game_id.split('_', 3)
        hour, other = self.game_start_time.split(':', 2)
        minute = other[:2]
        am_pm = other[2:]
        if am_pm == "PM":
            hour = int(hour)+11
        self.date = datetime.datetime(int(year), int(month), int(day), int(hour), int(minute))
dataset/ETHPy150Open zachpanz88/mlbgame/mlbgame/game.py/GameScoreboard.__init__/swapped operands of `>`