def extension_elements_to_elements(extension_elements, schemas):
 res = []
 if isinstance(schemas, list):
  pass
 elif isinstance(schemas, dict):
  schemas = schemas.values()
 else:
  return res
 for extension_element in extension_elements:
  for schema in schemas:
   inst = extension_element_to_element(extension_element, schema.ELEMENT_FROM_STRING, schema.NAMESPACE)
   if inst:
    res.append(inst)
    break
 return res

def extension_elements_to_elements ( extension_elements , schemas ) : res = [ ] if isinstance ( schemas , list ) : pass elif isinstance ( schemas , dict ) : schemas = schemas . values ( ) else : return res for extension_element in extension_elements : for schema in schemas : inst = extension_element_to_element ( extension_element , schema . ELEMENT_FROM_STRING , schema . NAMESPACE ) if inst : res . append ( inst ) break return res
create a list of elements each one matching one of the given extension elements .