<s> """<STR_LIT>""" <EOL> def filter_images ( images , filter_dict ) : <EOL> """<STR_LIT>""" <EOL> filter_function = lambda image : ( "<STR_LIT:id>" not in filter_dict or filter_dict [ "<STR_LIT:id>" ] == image . id ) and ( "<STR_LIT>" not in filter_dict or filter_dict [ "<STR_LIT>" ] == image . id ) and ( "<STR_LIT:name>" not in filter_dict or filter_dict [ "<STR_LIT:name>" ] == image . id ) and ( "<STR_LIT>" not in filter_dict or filter_dict [ "<STR_LIT>" ] == image . id ) <EOL> return filter ( filter_function , images ) <EOL> def filter_instances ( instances , filter_dict ) : <EOL> """<STR_LIT>""" <EOL> filter_function = lambda instance : ( "<STR_LIT:id>" not in filter_dict or filter_dict [ "<STR_LIT:id>" ] == instance . id ) and ( "<STR_LIT:state>" not in filter_dict or filter_dict [ "<STR_LIT:state>" ] == instance . state ) <EOL> return filter ( filter_function , instances ) <EOL> def filter_realms ( realms , filter_dict ) : <EOL> """<STR_LIT>""" <EOL> filter_function = lambda realm : ( "<STR_LIT:id>" not in filter_dict or filter_dict [ "<STR_LIT:id>" ] == realm . id ) <EOL> return filter ( filter_function , realms ) </s>
