(fn, **kwargs)
return fn(**kwargs)
Calls `fn` only with the keyword arguments that `fn` accepts.
Calls `fn` only with the keyword arguments that `fn` accepts.
Calls fn only with the keyword arguments that fn accepts .
def call_with_accepted_args(fn, **kwargs):
  """Calls `fn` only with the keyword arguments that `fn` accepts."""
  kwargs = {k: v for k, v in six.iteritems(kwargs) if _has_arg(fn, k)}
  logging.debug("Calling %s with args %s.", fn, kwargs)
  return fn(**kwargs)
def call_with_accepted_args ( fn , * * kwargs ) : kwargs = { k : v for k , v in six . iteritems ( kwargs ) if _has_arg ( fn , k ) } logging . debug ( "Calling %s with args %s." , fn , kwargs ) return fn ( * * kwargs )