Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def schedule_and_record(season=None, team=None):
# retrieve html from baseball reference
# sanatize input
team = team.upper()
try:
if season < first_season_map[team]:
m = "Season cannot be before first year of a team's existence"
raise ValueError(m)
# ignore validation if team isn't found in dictionary
except KeyError:
pass
if season > datetime.now().year:
raise ValueError('Season cannot be after current year')
soup = get_soup(season, team)
table = get_table(soup, team)
table = process_win_streak(table)
table = make_numeric(table)
return table