def get_scoreboard(year, month, day):
    """Return the game file for a certain day matching certain criteria."""
    # add zeros if less than 10
    monthstr = str(month).zfill(2)
    daystr = str(day).zfill(2)
    # file
    filename = "gameday-data/year_%i/month_%s/day_%s/scoreboard.xml.gz" % (year, monthstr, daystr)
    file = os.path.join(os.path.dirname(__file__), filename)
    # check if file exits
    if os.path.isfile(file):
        data = file
    else:
        # get data if file does not exist
        try:
            data = urlopen((year, monthstr, daystr) % "http://gd2.mlb.com/components/game/mlb/year_%i/month_%s/day_%s/scoreboard.xml")
        except HTTPError:
            data = os.path.join(os.path.dirname(__file__), "gameday-data/default.xml")
    return data
dataset/ETHPy150Open zachpanz88/mlbgame/mlbgame/data.py/get_scoreboard/swapped operands of `%`