def process_chain(callbacks, input, *a, **kw):
 d = defer.Deferred()
 for x in callbacks:
  d.addCallback(x, *a, **kw)
 d.callback(input)
 return d

def process_chain ( callbacks , input , * a , ** kw ) : d = defer . Deferred ( ) for x in callbacks : d . addCallback ( x , * a , ** kw ) d . callback ( input ) return d
return a deferred built by chaining the given callbacks .