(games, teams)
return cleaned_game_list
This one is a doozy. If you find a cleaner or more efficient way, please let me know.

    Ordered list of preferred games to match the order of their corresponding team and clean the 'None' element
    produced by the'map' function.

    return the cleaned game list. lemony fresh!!!

    TODO: For V2, this needs to be changed to return game list in different order, instead of a single way. Having that handled by different methods is the way.... this is the way !!!!
This one is a doozy. If you find a cleaner or more efficient way, please let me know.
This one is a doozy . If you find a cleaner or more efficient way please let me know .
def prioritize_pref_games(games, teams):
    """
    This one is a doozy. If you find a cleaner or more efficient way, please let me know.

    Ordered list of preferred games to match the order of their corresponding team and clean the 'None' element
    produced by the'map' function.

    return the cleaned game list. lemony fresh!!!

    TODO: For V2, this needs to be changed to return game list in different order, instead of a single way. Having that handled by different methods is the way.... this is the way !!!!
    """

    ordered_game_list = map(lambda team: next(
        (game for game in games if game.away_team_id == team or game.home_team_id == team), None),
                            teams)
    cleaned_game_list = list(filter(None, list(dict.fromkeys(ordered_game_list))))
    return cleaned_game_list
def prioritize_pref_games ( games , teams ) : ordered_game_list = map ( lambda team : next ( ( game for game in games if game . away_team_id == team or game . home_team_id == team ) , None ) , teams ) cleaned_game_list = list ( filter ( None , list ( dict . fromkeys ( ordered_game_list ) ) ) ) return cleaned_game_list