def get_resource_manager_extra_kwargs(f, args, allow_conflicts=False):
 hooks = getattr(f, 'resource_manager_kwargs_hooks', [])
 extra_kwargs = {}
 for hook in hooks:
  hook_name = hook.__name__
  hook_kwargs = hook(args)
  conflicting_keys = (set(hook_kwargs.keys()) & set(extra_kwargs.keys()))
  if (conflicting_keys and (not allow_conflicts)):
   raise Exception(("Hook '%(hook_name)s' is attempting to redefine attributes '%(conflicting_keys)s'" % locals()))
  extra_kwargs.update(hook_kwargs)
 return extra_kwargs

def get_resource_manager_extra_kwargs ( f , args , allow_conflicts = False ) : hooks = getattr ( f , 'resource_manager_kwargs_hooks' , [ ] ) extra_kwargs = { } for hook in hooks : hook_name = hook . __name__ hook_kwargs = hook ( args ) conflicting_keys = ( set ( hook_kwargs . keys ( ) ) & set ( extra_kwargs . keys ( ) ) ) if ( conflicting_keys and ( not allow_conflicts ) ) : raise Exception ( ( "Hook '%(hook_name)s' is attempting to redefine attributes '%(conflicting_keys)s'" % locals ( ) ) ) extra_kwargs . update ( hook_kwargs ) return extra_kwargs
return extra_kwargs by calling resource manager kwargs hooks .