Send the message to the observer.

        :param msg: the message to send
        :param frm: the name of the node which sent this `msg`
13769
def send_to_observer(self, msg, frm):
        
        logger.debug("{} sending message to observer: {}".
                     format(self, (msg, frm)))
        self._observer.append_input(msg, frm)
691321
def send(self, message):
        
        if not isinstance(message, (Msg, MsgProto)):
            raise ValueError("Expected Msg or MsgProto, got %s" % message)

        if self.steam_id:
            message.steamID = self.steam_id
        if self.session_id:
            message.sessionID = self.session_id

        if self.verbose_debug:
            self._LOG.debug("Outgoing: %s\n%s" % (repr(message), str(message)))
        else:
            self._LOG.debug("Outgoing: %s", repr(message))

        data = message.serialize()

        if self.channel_key:
            if self.channel_hmac:
                data = crypto.symmetric_encrypt_HMAC(data, self.channel_key, self.channel_hmac)
            else:
                data = crypto.symmetric_encrypt(data, self.channel_key)

        self.connection.put_message(data)
1286498
public void sendMessage(ISUPMessage msg, int dpc) throws ParameterException, IOException {
        if (!msg.hasAllMandatoryParameters()) {
            throw new ParameterException("Message does not have all required parameters!");
        }
        sendOnCircuit(getCircuit(msg, dpc), msg);
    }
616227
def send_message(self, message):
        
        self._steam.send(MsgProto(EMsg.ClientFriendMsg), {
            'steamid': self.steam_id,
            'chat_entry_type': EChatEntryType.ChatMsg,
            'message': message.encode('utf8'),
            })
1153808
def send_message(self, msg, stats=True):
        
        self.send_jsonified(proto.json_encode(msg), stats)
1315610
def send(self, msg):
        """"""
        if self._conn:
            self._conn.write_data(msg.message, msg.response_command)
350093
def send_message(self, msg):
        
        assert get_thread_ident() == self.ioloop_thread_id
        data = str(msg) + "\n"
        # Log all sent messages here so no one else has to.
        if self._logger.isEnabledFor(logging.DEBUG):
            self._logger.debug("Sending to {}: {}"
                               .format(self.bind_address_string, repr(data)))
        if not self._connected.isSet():
            raise KatcpClientDisconnected('Not connected to device {0}'.format(
                self.bind_address_string))
        try:
            return self._stream.write(data)
        except Exception:
            self._logger.warn('Could not send message {0!r} to {1!r}'
                              .format(str(msg), self._bindaddr), exc_info=True)
            self._disconnect(exc_info=True)
547460
def send(self, target, nick, msg, msgtype, ignore_length=False, filters=None):
        
        if not isinstance(msg, str):
            raise Exception("Trying to send a %s to irc, only strings allowed." % type(msg).__name__)
        if filters is None:
            filters = self.outputfilter[target]
        for i in filters:
            if target != self.config['core']['ctrlchan']:
                msg = i(msg)
        # Avoid spam from commands that produce excessive output.
        if not ignore_length:
            # Ignore everything after the first 800 chars.
            msg = misc.truncate_msg(msg, 800)

        # We can't send messages > 512 bytes to irc.
        max_len = misc.get_max_length(target, msgtype)
        msgs = self.build_split_msg(msg, max_len)

        for i in msgs:
            self.do_log(target, nick, i, msgtype)
            if msgtype == 'action':
                self.rate_limited_send('action', target, i)
            else:
                self.rate_limited_send('privmsg', target, i)
949189
def _publish(self, msg):
        
        connection = self._connection.clone()
        publish = connection.ensure(self.producer, self.producer.publish,
                                    errback=self.__error_callback,
                                    max_retries=MQ_PRODUCER_MAX_RETRIES)
        publish(json.dumps(msg), exchange=self._exchange,
                routing_key=self._routing_key, declare=[self._queue])
        logging.debug('Publisher: message sent: %s', msg)
1055972
def send_notification(self, method, params):
        
        msg = self._encoder.create_notification(method, params)
        self._send_message(msg)
30588
def send_messages(self, messages):
        
        counter = 0
        for message in messages:
            res, _ = self._send(message)
            if res:
                counter += 1

        return counter
721544
def send_msg(self, msg):
        
        for receiver in msg.receivers:
            current_receiver = self.receivers.get(receiver, self.default_receiver)
            current_receiver.send_msg(msg)
945807
def send(self, msg, stat=None) -> None:
        
        self.logger.trace("{} sending {}".format(self, msg.__class__.__name__),
                          extra={"cli": True, "tags": ['sending']})
        self.logger.trace("{} sending {}".format(self, msg))
        if stat:
            self.stats.inc(stat)
        self.outBox.append(msg)
1012749
def sendCommand(self, **msg):
		
		assert 'type' in msg, 'Message type is required.'

		msg['id'] = self.next_message_id
		self.next_message_id += 1

		if self.next_message_id >= maxint:
			self.next_message_id = 1

		self.sendMessage(json.dumps(msg))
		return msg['id']
1063388
def send(self, msg):
        
        logger.debug("{}'s elector sending {}".format(self.name, msg))
        self.outBox.append(msg)
58660
def send(self, message):
        
        message.update(self._globalFields)
        errors = []
        for dest in self._destinations:
            try:
                dest(message)
            except:
                errors.append(sys.exc_info())
        if errors:
            raise _DestinationsSendError(errors)
335137
def send(self, msg):
        
        with self._pub_lock:
            self.publish.send_string(msg)
        return self