lisa.utils.dispatch_kwargs#

lisa.utils.dispatch_kwargs(funcs, kwargs, call=True, allow_overlap=False)[source]#

Dispatch the provided kwargs mapping to the funcs functions, based on their signature.

Parameters:
  • funcs (list(collections.abc.Callable)) – List of functions to dispatch to.

  • kwargs (dict(str, object)) – Dictionary of arguments to pass to the functions.

  • call (bool) – If True, the functions are called and the return value is a {f: result} with f functions of funcs. If False, the result is just a mapping of arguments ready to be used to call the given function.

  • allow_overlap (bool) – If False, the provided functions are not allowed to have overlapping parameters. If they do, a TypeError is raised.