def request_deferred(request):
 d = Deferred()
 if request.callback:
  d.addCallbacks(request.callback, request.errback)
 (request.callback, request.errback) = (d.callback, d.errback)
 return d

def request_deferred ( request ) : d = Deferred ( ) if request . callback : d . addCallbacks ( request . callback , request . errback ) ( request . callback , request . errback ) = ( d . callback , d . errback ) return d
wrap a request inside a deferred .