def filter_properties_target(namespaces_iter, resource_types, properties_target):
 def filter_namespace(namespace):
  for asn in namespace.get('resource_type_associations'):
   if ((asn.get('name') in resource_types) and (asn.get('properties_target') == properties_target)):
    return True
  return False
 return filter(filter_namespace, namespaces_iter)

def filter_properties_target ( namespaces_iter , resource_types , properties_target ) : def filter_namespace ( namespace ) : for asn in namespace . get ( 'resource_type_associations' ) : if ( ( asn . get ( 'name' ) in resource_types ) and ( asn . get ( 'properties_target' ) == properties_target ) ) : return True return False return filter ( filter_namespace , namespaces_iter )
filter metadata namespaces based on the given resource types and properties target .