#NEWLINE# def get_summoner_spells( ids = None ) : #NEWLINE# #INDENT# '\n    Gets a bunch of summoner spells (or all of them)\n\n    Args:\n        ids (list<int>): the IDs of the summoner spells to get (or None to get all summoner spells) (default None)\n\n    Returns:\n        list<SummonerSpell>: the summoner spells\n    ' #NEWLINE# if ( ids is not None ) : #NEWLINE# #INDENT# summoner_spells = { summoner_spell . id : summoner_spell for summoner_spell in get_summoner_spells ( ) } #NEWLINE# results = [ ] #NEWLINE# for id_ in ids : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# summoner_spell = summoner_spells [ id_ ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# summoner_spell = None #NEWLINE# #UNINDENT# results . append ( summoner_spell ) #NEWLINE# #UNINDENT# return results #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if cassiopeia . core . requests . data_store . has_all ( cassiopeia . type . core . staticdata . SummonerSpell ) : #NEWLINE# #INDENT# return cassiopeia . core . requests . data_store . get_all ( cassiopeia . type . core . staticdata . SummonerSpell ) #NEWLINE# #UNINDENT# summoner_spells = cassiopeia . dto . staticdataapi . get_summoner_spells ( ) #NEWLINE# summoner_spells = [ cassiopeia . type . core . staticdata . SummonerSpell ( summoner_spell [ 1 ] ) for summoner_spell in summoner_spells . data . items ( ) ] #NEWLINE# cassiopeia . core . requests . data_store . store ( summoner_spells , [ summoner_spell . id for summoner_spell in summoner_spells ] , [ cassiopeia . type . core . staticdata . SummonerSpell ] ) #NEWLINE# return summoner_spells