def get_packet_id(self, packet):
        """
        Returns the ID of a protocol buffer packet. Returns None
        if no ID was found.
        """

        for p in self._packets:
            if isinstance(packet, p['cls']):
                return p['id']

        return None
def get_packet_id ( self , packet ) : for p in self . _packets : if isinstance ( packet , p [ 'cls' ] ) : return p [ 'id' ] return None
Returns the ID of a protocol buffer packet. Returns None
        if no ID was found.