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

        data is expected to come from the `box_score()` function.
        """
        self.game_id = data['game_id']
        data.pop('game_id', None)
        # dictionary of innings
        self.innings = []
        # loops through the innings
        for x in sorted(data):
            try:
                result = {'inning':int(x), 'home':int(data[x]['home']), 'away':int(data[x]['away'])}
            # possible error when 9th innning home team has 'x' becuase they did not bat
            except __HOLE__:
                result = {'inning':int(x), 'home':data[x]['home'], 'away':int(data[x]['away'])}
            self.innings.append(result)
dataset/ETHPy150Open zachpanz88/mlbgame/mlbgame/game.py/GameBoxScore.__init__