<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def keep_season(show, keep):
 """ Keep only the latest season. """

    deleted = 0
    print('%s Cleaning %s to latest season.' % (datestr(), show.title))
    for season in show.seasons()[:-1]:
        for episode in season.episodes():
            delete_episode(episode)
            deleted += 1
    return deleted