def allow_lazy(func, *resultclasses):
 @wraps(func)
 def wrapper(*args, **kwargs):
  for arg in (list(args) + list(six.itervalues(kwargs))):
   if isinstance(arg, Promise):
    break
  else:
   return func(*args, **kwargs)
  return lazy(func, *resultclasses)(*args, **kwargs)
 return wrapper

def allow_lazy ( func , * resultclasses ) : @ wraps ( func ) def wrapper ( * args , ** kwargs ) : for arg in ( list ( args ) + list ( six . itervalues ( kwargs ) ) ) : if isinstance ( arg , Promise ) : break else : return func ( * args , ** kwargs ) return lazy ( func , * resultclasses ) ( * args , ** kwargs ) return wrapper
a decorator that allows a function to be called with one or more lazy arguments .