def get_from_module(identifier, module_params, module_name, instantiate=False, kwargs=None):
 if isinstance(identifier, six.string_types):
  res = None
  if (identifier in _GLOBAL_CUSTOM_OBJECTS):
   res = _GLOBAL_CUSTOM_OBJECTS[identifier]
  if (not res):
   res = module_params.get(identifier)
  if (not res):
   raise ValueError(((('Invalid ' + str(module_name)) + ': ') + str(identifier)))
  if (instantiate and (not kwargs)):
   return res()
  elif (instantiate and kwargs):
   return res(**kwargs)
  else:
   return res
 elif isinstance(identifier, dict):
  name = identifier.pop('name')
  res = None
  if (name in _GLOBAL_CUSTOM_OBJECTS):
   res = _GLOBAL_CUSTOM_OBJECTS[name]
  if (not res):
   res = module_params.get(name)
  if res:
   return res(**identifier)
  else:
   raise ValueError(((('Invalid ' + str(module_name)) + ': ') + str(identifier)))
 return identifier

def get_from_module ( identifier , module_params , module_name , instantiate = False , kwargs = None ) : if isinstance ( identifier , six . string_types ) : res = None if ( identifier in _GLOBAL_CUSTOM_OBJECTS ) : res = _GLOBAL_CUSTOM_OBJECTS [ identifier ] if ( not res ) : res = module_params . get ( identifier ) if ( not res ) : raise ValueError ( ( ( ( 'Invalid ' + str ( module_name ) ) + ': ' ) + str ( identifier ) ) ) if ( instantiate and ( not kwargs ) ) : return res ( ) elif ( instantiate and kwargs ) : return res ( ** kwargs ) else : return res elif isinstance ( identifier , dict ) : name = identifier . pop ( 'name' ) res = None if ( name in _GLOBAL_CUSTOM_OBJECTS ) : res = _GLOBAL_CUSTOM_OBJECTS [ name ] if ( not res ) : res = module_params . get ( name ) if res : return res ( ** identifier ) else : raise ValueError ( ( ( ( 'Invalid ' + str ( module_name ) ) + ': ' ) + str ( identifier ) ) ) return identifier
retrieves a class or function member of a module .