code: def publish_event(self, channel, event, message):
          '''Publish a new event ``message`` to a ``channel``.
          '''
          assert self.protocol is not None, "Protocol required"
          msg = {'event': event, 'channel': channel}
          if message:
              msg['data'] = message
          return self.publish(channel, msgf publish_event(self, channel, event, message):
          '''Publish a new event ``message`` to a ``channel``.
          '''
          assert self.protocol is not None, "Protocol required"
          msg = {'event': event, 'channel': channel}
          if message:
              msg['data'] = message
          return self.publish(channel, msg)
docs: Publish a new event ``message`` to a ``channel``.