def fun_takes_kwargs(fun, kwlist=[]):
 argspec = getattr(fun, 'argspec', getargspec(fun))
 (args, _varargs, keywords, _defaults) = argspec
 if (keywords != None):
  return kwlist
 return filter(partial(operator.contains, args), kwlist)

def fun_takes_kwargs ( fun , kwlist = [ ] ) : argspec = getattr ( fun , 'argspec' , getargspec ( fun ) ) ( args , _varargs , keywords , _defaults ) = argspec if ( keywords != None ) : return kwlist return filter ( partial ( operator . contains , args ) , kwlist )
with a function .