def deferredDict(d):
    if len(d) == 0:
        return defer.succeed({})

    def handle(results, names):
        rvalue = {}
        for index in range(len(results)):
            rvalue[names[index]] = results[index][1]
        return rvalue

    dl = defer.DeferredList(d.values())
    return dl.addCallback(handle, d.keys())
Just like a :class:`defer.DeferredList` but instead accepts and returns a :class:`dict`.
dataset/ETHPy150Open OpenBazaar/OpenBazaar-Server/dht/utils.py/deferredDict