<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def with_defaults(method, nparams, defaults=None):
 """Call method with nparams positional parameters, all non-specified defaults are passed None. :method: the method to call :nparams: the number of parameters the function expects :defaults: the default values to pass in for the last len(defaults) params """

  args = [None] * nparams if not defaults else defaults + max(nparams - len(defaults), 0) * [None]
  return method(*args)