(series, teams)
return cleaned_series_list
Ordered list of preferred series to match the order of their corresponding team and clean the 'None' element
        produced by the'map' function.
Ordered list of preferred series to match the order of their corresponding team and clean the 'None' element
        produced by the'map' function.
Ordered list of preferred series to match the order of their corresponding team and clean the None element produced by the map function .
def prioritize_pref_series(series, teams):
    """
        Ordered list of preferred series to match the order of their corresponding team and clean the 'None' element
        produced by the'map' function.
    """
    ordered_series_list = map(lambda team: next(
        (single_series for single_series in series if single_series.matchupTeams[0].team.id == team or single_series.matchupTeams[1].team.id == team), None),
                            teams)
    cleaned_series_list = list(filter(None, list(dict.fromkeys(ordered_series_list))))
    return cleaned_series_list
def prioritize_pref_series ( series , teams ) : ordered_series_list = map ( lambda team : next ( ( single_series for single_series in series if single_series . matchupTeams [ 0 ] . team . id == team or single_series . matchupTeams [ 1 ] . team . id == team ) , None ) , teams ) cleaned_series_list = list ( filter ( None , list ( dict . fromkeys ( ordered_series_list ) ) ) ) return cleaned_series_list