def send(self, obj):
        
        d = None
        if isinstance(obj, IQMessage):        
            try:
                
                log.msg("Sending %s" % obj['id'])
                d = defer.Deferred()
                self._pending[obj['id']] = d
                
            except KeyError:
                pass
            
        xmlstream.XmlStream.send(self, obj)
        

        return d
Do default xmlstream.send, but put obj[id] to _pending response dict
dataset/ETHPy150Open selfsk/nodeset.core/src/nodeset/core/pubsub/agent.py/XmlStreamJabber.send