import inspect


def _accepts_args(fn, *args, **kwargs):
  """Returns True if `fn` can accept `*args` and `**kwargs`."""
  try:
    inspect.signature(fn).bind_partial(*args, **kwargs)
    return True
  except TypeError:
    return False