Ratings of all the episodes of all the seasons

def get_ratings(data):
    """Ratings of all the episodes of all the seasons"""
    episodes = data['episodes']
    ratings = {}
    for season in episodes:
        ratings[season] = collapse(episodes[season])
    return co.OrderedDict(sorted(ratings.items()))