(series, teams)
return list(single_series for single_series in set(series) if {single_series.matchupTeams[0].team.id, single_series.matchupTeams[1].team.id}.intersection(set(teams)))
Filter the list 'single_series' and keep only the ones which the teams in the list 'teams' are part of.

        TODO: make a filter_list function that works for both list of games and list of series. need to add lost of attribute to look for and compare (intersection)
Filter the list 'single_series' and keep only the ones which the teams in the list 'teams' are part of.
Filter the list single_series and keep only the ones which the teams in the list teams are part of .
def filter_list_of_series(series, teams):
    """
    Filter the list 'single_series' and keep only the ones which the teams in the list 'teams' are part of.

        TODO: make a filter_list function that works for both list of games and list of series. need to add lost of attribute to look for and compare (intersection)
    """

    return list(single_series for single_series in set(series) if {single_series.matchupTeams[0].team.id, single_series.matchupTeams[1].team.id}.intersection(set(teams)))
def filter_list_of_series ( series , teams ) : return list ( single_series for single_series in set ( series ) if { single_series . matchupTeams [ 0 ] . team . id , single_series . matchupTeams [ 1 ] . team . id } . intersection ( set ( teams ) ) )