Interface function to send and receive an IPMI message.

        target: IPMI target
        req: IPMI message request

        Returns the IPMI message response.
199173
def send_and_receive(self, req):
        
        rx_data = self._send_and_receive(target=req.target,
                                         lun=req.lun,
                                         netfn=req.netfn,
                                         cmdid=req.cmdid,
                                         payload=encode_message(req))
        rsp = create_message(req.netfn + 1, req.cmdid, req.group_extension)
        decode_message(rsp, rx_data)
        return rsp
863095
def get_response(self):
        """"""
        request = getattr(requests, self.request_method, None)
        if request is None and self._request_method is None:
            raise ValueError("A effective http request method must be set")
        if self.request_url is None:
            raise ValueError(
                "Fatal error occurred, the class property \"request_url\" is"
                "set to None, reset it with an effective url of dingtalk api."
            )
        response = request(self.request_url, **self.kwargs)
        self.response = response
        return response
841037
async def postback_send(msg: BaseMessage, platform: Platform) -> Response:
    

    await platform.inject_message(msg)

    return json_response({
        'status': 'ok',
    })
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)
1070107
def send(self, command, sender, target, args, kwargs):
        
        command = get_command(command)
        data = {'command': command.__name__,
                'id': create_aid(),
                'sender': actor_identity(sender),
                'target': actor_identity(target),
                'args': args if args is not None else (),
                'kwargs': kwargs if kwargs is not None else {}}

        waiter = self._loop.create_future()
        ack = None
        if command.ack:
            ack = create_aid()
            data['ack'] = ack
            self.pending_responses[ack] = waiter

        try:
            self.write(data)
        except Exception as exc:
            waiter.set_exception(exc)
            if ack:
                self.pending_responses.pop(ack, None)
        else:
            if not ack:
                waiter.set_result(None)
        return waiter
635770
async def message(self, target, message):
        
        hostmask = self._format_user_mask(self.nickname)
        # Leeway.
        chunklen = protocol.MESSAGE_LENGTH_LIMIT - len(
            '{hostmask} PRIVMSG {target} :'.format(hostmask=hostmask, target=target)) - 25

        for line in message.replace('\r', '').split('\n'):
            for chunk in chunkify(line, chunklen):
                # Some IRC servers respond with "412 Bot :No text to send" on empty messages.
                await self.rawmsg('PRIVMSG', target, chunk or ' ')
19891
def target_message(conn, payload):
    
    try:
        yield from conn.send(json.dumps(payload))
    except Exception as e:
        logger.debug('could not send', e)
1218324
def on_receive(self, message=None, wire=None, event_origin=None):

        

        self.trigger("before_call", message)

        fn_name = message.data
        pmsg = self.prepare_message

        try:
            for handler in self.handlers:
                handler.incoming(message, self)

            fn = self.get_function(fn_name, message.path)
        except Exception as inst:
            wire.respond(message, ErrorMessage(str(inst)))
            return

        if callable(fn) and getattr(fn, "exposed", False):
            try:
                r = fn(*message.args, **message.kwargs)
                if isinstance(r,Message):
                    wire.respond(message, pmsg(r))
                else:
                    wire.respond(message, pmsg(Message(r)))
            except Exception as inst:
                if self.debug:
                    wire.respond(message, pmsg(ErrorMessage(str(traceback.format_exc()))))
                else:
                    wire.respond(message, pmsg(ErrorMessage(str(inst))))
        else:
            wire.respond(
                message,
                pmsg(
                    ErrorMessage("action '%s' not exposed on API (%s)" % (fn_name, self.__class__.__name__)))
                )

        self.trigger("after_call", message)
575510
def send_message(
        self, request: str, response_expected: bool, **kwargs: Any
    ) -> Response:
        
        self.socket.send_string(request)
        return Response(self.socket.recv().decode())
1049675
function ( target, arg ) {
		try {
			target.postMessage( arg, "*" );
		}
		catch ( e ) {
			utility.error( e, arguments, this );
		}

		return target;
	}
186184
def send_response_message(self, request_id, meta, body):
        
        self.response_messages.append((request_id, meta, body))
365795
def send_and_await_response(self,request):
        
        if self._state == STATE_DISCONNECTED:
            raise Exception("WAMP is currently disconnected!")
        wait_queue = queue.Queue()
        request_id = request.request_id
        self._requests_pending[request_id] = wait_queue;
        self.send_message(request)
        try:
            return wait_queue.get(block=True,timeout=self.timeout)
        except Exception as ex:
            raise Exception("Did not receive a response!")
307780
def send_message(host, data, timeout=None, properties=None):
    
    channel = _get_channel(host, timeout)

    if not properties:
        properties = pika.BasicProperties(
            content_type="application/json",
            delivery_mode=2,
            headers={"UUID": str(uuid.uuid4())}
        )

    parameters = settings.get_amqp_settings()[host]

    channel.basic_publish(
        exchange=parameters["exchange"],
        routing_key=parameters["in_key"],
        properties=properties,
        body=data
    )
1070861
def send_message(self, data, inc_session_id=False,
                     callback_function=None):
        
        self._check_registered()

        if not self.target_platform and \
           self.namespace not in self._socket_client.app_namespaces:
            if self.supporting_app_id is not None:
                self.launch()

            else:
                raise UnsupportedNamespace(
                    ("Namespace {} is not supported by running"
                     "application.").format(self.namespace))

        return self._message_func(
            self.namespace, data, inc_session_id, callback_function)
996011
def create_ip_arp_reply(srchw, dsthw, srcip, targetip):
    '''
    
    '''
    pkt = create_ip_arp_request(srchw, srcip, targetip)
    pkt[0].dst = dsthw
    pkt[1].operation = ArpOperation.Reply
    pkt[1].targethwaddr = dsthw
    return pkt
1262407
def got_response(self):
        
        return any(message.sender != self.initiator
                   for message in self.messages)
1206093
def send(self, message):
        
        message = message.SerializeToString()
        self.socket.sendall(struct.pack('!I', len(message)) + message)

        length = struct.unpack('!I', self.socket.recv(4))[0]
        response = riemann_client.riemann_pb2.Msg()
        response.ParseFromString(socket_recvall(self.socket, length))

        if not response.ok:
            raise RiemannError(response.error)

        return response