<s> import datetime <EOL> import cassiopeia . riotapi <EOL> import cassiopeia . dto . matchlistapi <EOL> import cassiopeia . core . requests <EOL> import cassiopeia . type . core . common <EOL> import cassiopeia . type . core . matchlist <EOL> def get_match_list ( summoner , num_matches = <NUM_LIT:0> , begin_index = <NUM_LIT:0> , begin_time = <NUM_LIT:0> , end_time = <NUM_LIT:0> , champions = None , ranked_queues = None , seasons = None ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( seasons , str ) : <EOL> seasons = cassiopeia . type . core . common . Season ( seasons . upper ( ) ) <EOL> elif isinstance ( seasons , list ) and all ( isinstance ( s , str ) for s in seasons ) : <EOL> seasons = [ cassiopeia . type . core . common . Season ( s . upper ( ) ) for s in seasons ] <EOL> if isinstance ( ranked_queues , str ) : <EOL> ranked_queues = cassiopeia . type . core . common . Queue ( ranked_queues . upper ( ) . replace ( "<STR_LIT>" , "<STR_LIT>" ) . replace ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> elif isinstance ( ranked_queues , list ) and all ( isinstance ( q , str ) for q in ranked_queues ) : <EOL> ranked_queues = [ cassiopeia . type . core . common . Queue ( q . upper ( ) . replace ( "<STR_LIT>" , "<STR_LIT>" ) . replace ( "<STR_LIT>" , "<STR_LIT>" ) ) for q in ranked_queues ] <EOL> if isinstance ( begin_time , datetime . datetime ) : <EOL> epoch = datetime . datetime . utcfromtimestamp ( <NUM_LIT:0> ) <EOL> delta = begin_time - epoch <EOL> begin_time = int ( delta . total_seconds ( ) * <NUM_LIT:1000> ) <EOL> if isinstance ( end_time , datetime . datetime ) : <EOL> epoch = datetime . datetime . utcfromtimestamp ( <NUM_LIT:0> ) <EOL> delta = end_time - epoch <EOL> end_time = int ( delta . total_seconds ( ) * <NUM_LIT:1000> ) <EOL> champion_ids = [ champion . id for champion in champions ] if isinstance ( champions , list ) else champions . id if champions else None <EOL> ranked_queues = [ queue . value for queue in ranked_queues ] if isinstance ( ranked_queues , list ) else ranked_queues . value if ranked_queues else None <EOL> seasons = [ season . value for season in seasons ] if isinstance ( seasons , list ) else seasons . value if seasons else None <EOL> history = cassiopeia . dto . matchlistapi . get_match_list ( summoner . id , num_matches , begin_index , begin_time , end_time , champion_ids , ranked_queues , seasons ) <EOL> if cassiopeia . core . requests . load_policy is cassiopeia . type . core . common . LoadPolicy . eager : <EOL> cassiopeia . riotapi . get_champions ( ) if history . champion_ids else None <EOL> return [ cassiopeia . type . core . matchlist . MatchReference ( ref ) for ref in history . matches ] </s>
