#NEWLINE# def prune_targets( self , targets , get_friendly ) : #NEWLINE# #INDENT# res = [ ] #NEWLINE# for target in targets : #NEWLINE# #INDENT# is_friendly_minion = any ( map ( ( lambda c : ( c == target ) ) , self . player . minions ) ) #NEWLINE# is_friendly_hero = ( target == self . player . hero ) #NEWLINE# is_friendly = ( is_friendly_minion or is_friendly_hero ) #NEWLINE# if ( is_friendly == get_friendly ) : #NEWLINE# #INDENT# res . append ( target ) #NEWLINE# #UNINDENT# #UNINDENT# return res