def _curry_callable(obj, *args, **kwargs):
 if isinstance(obj, types.MethodType):
  return (invoke_member, ((obj.im_self, obj.im_func.__name__) + args), kwargs)
 elif isinstance(obj, types.BuiltinMethodType):
  if (not obj.__self__):
   return (obj, args, kwargs)
  else:
   return (invoke_member, ((obj.__self__, obj.__name__) + args), kwargs)
 elif (isinstance(obj, types.ObjectType) and hasattr(obj, '__call__')):
  return (obj, args, kwargs)
 elif isinstance(obj, (types.FunctionType, types.BuiltinFunctionType, types.ClassType, types.UnboundMethodType)):
  return (obj, args, kwargs)
 else:
  raise ValueError('obj must be callable')

def _curry_callable ( obj , * args , ** kwargs ) : if isinstance ( obj , types . MethodType ) : return ( invoke_member , ( ( obj . im_self , obj . im_func . __name__ ) + args ) , kwargs ) elif isinstance ( obj , types . BuiltinMethodType ) : if ( not obj . __self__ ) : return ( obj , args , kwargs ) else : return ( invoke_member , ( ( obj . __self__ , obj . __name__ ) + args ) , kwargs ) elif ( isinstance ( obj , types . ObjectType ) and hasattr ( obj , '__call__' ) ) : return ( obj , args , kwargs ) elif isinstance ( obj , ( types . FunctionType , types . BuiltinFunctionType , types . ClassType , types . UnboundMethodType ) ) : return ( obj , args , kwargs ) else : raise ValueError ( 'obj must be callable' )
takes a callable and arguments and returns a task queue tuple .