#NEWLINE# def get_teams_by_summoner( summoners ) : #NEWLINE# #INDENT# "Gets (a) summoner(s)' teams\n\n    summoners    Summoner | list<Summoner>        the summoner(s) to get teams for\n\n    return       list<Team> | list<list<Team>>    the summoner(s)' teams\n    " #NEWLINE# ids = ( [ summoner . id for summoner in summoners ] if isinstance ( summoners , list ) else summoners . id ) #NEWLINE# teams = cassiopeia . core . requests . call_with_ensured_size ( cassiopeia . dto . teamapi . get_teams_by_summoner_id , 10 , ids ) #NEWLINE# if ( cassiopeia . core . requests . load_policy is cassiopeia . type . core . common . LoadPolicy . eager ) : #NEWLINE# #INDENT# summoner_ids = set ( ) #NEWLINE# for ( _ , lst ) in teams . items ( ) : #NEWLINE# #INDENT# for team in lst : #NEWLINE# #INDENT# summoner_ids |= team . summoner_ids #NEWLINE# #UNINDENT# #UNINDENT# ( cassiopeia . riotapi . get_summoners_by_id ( list ( summoner_ids ) ) if summoner_ids else None ) #NEWLINE# #UNINDENT# if ( not isinstance ( summoner_ids , list ) ) : #NEWLINE# #INDENT# return [ cassiopeia . type . core . team . Team ( team ) for team in teams [ str ( ids ) ] ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return [ [ cassiopeia . type . core . team . Team ( team ) for team in teams [ str ( id_ ) ] ] for id_ in ids ]