human
I wrote the below code

    d = defer.Deferred()
    def onResult(success, result):
        if success:
            reactor.callFromThread(d.callback, result)
        else:
            reactor.callFromThread(d.errback, result)
    threadpool.callInThreadWithCallback(onResult, f, *args, **kwargs)
    return d

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def deferToThreadPool(reactor, threadpool, f, *args, **kwargs):