def emit(self, event, data, namespace=None, room=None, skip_sid=None,
             callback=None):
        namespace = namespace or '/'
        if callback is not None:
            if self.server is None:
                raise RuntimeError('Callbacks can only be issued from the '
                                   'context of a server.')
            if room is None:
                raise ValueError('Cannot use callback without a room set.')
            id = self._generate_ack_id(room, namespace, callback)
            callback = (room, namespace, id)
        else:
            callback = None
        self._publish({'method': 'emit', 'event': event, 'data': data,
                       'namespace': namespace, 'room': room,
                       'skip_sid': skip_sid, 'callback': callback})
Emit a message to a single client, a room, or all the clients
dataset/ETHPy150Open miguelgrinberg/python-socketio/socketio/pubsub_manager.py/PubSubManager.emit