Send this message over USB.
168111
def Send(self, usb, timeout_ms=None):
        """"""
        usb.BulkWrite(self.Pack(), timeout_ms)
        usb.BulkWrite(self.data, timeout_ms)
491706
def send_message(self, *args, **kwargs):
        """"""
        return send_message(*args, **self._merge_overrides(**kwargs)).run()
784269
def send_direct_message(self, text, user=None, delegate=None, screen_name=None, user_id=None, params={}):
        
        params = params.copy()
        if user is not None:
            params['user'] = user
        if user_id is not None:
            params['user_id'] = user_id
        if screen_name is not None:
            params['screen_name'] = screen_name
        params['text'] = text
        parser = txml.Direct(delegate)
        return self.__postPage('/direct_messages/new.xml', parser, params)
233760
def sendMessage(self, msg):
        
        if msg._messageType in (1, 2):
            assert msg.destination, 'Failed to specify a message destination'

        if msg.destination is not None:
            if msg.destination[0] == ':':
                p = self.clients.get(msg.destination, None)
            else:
                p = self.busNames.get(msg.destination, None)
                if p:
                    p = p[0]

            # print 'SND: ', msg._messageType, ' to ',  p.uniqueName, 'serial',
            # msg.serial,

            if p:
                p.sendMessage(msg)
            else:
                log.msg(
                    'Invalid bus name in msg.destination: '
                    + msg.destination
                )
        else:
            self.router.routeMessage(msg)
179579
def _send_msg(self, header, payload):
        """"""

        if self.verbose:
            print('->', repr(header))
            print('..', repr(payload))
        assert header.payload == len(payload)
        try:
            sent = self.socket.send(header + payload)
        except IOError as err:
            raise ConnError(*err.args)

        # FIXME FIXME FIXME:
        # investigate under which situations socket.send should be retried
        # instead of aborted.
        # FIXME FIXME FIXME
        if sent < len(header + payload):
            raise ShortWrite(sent, len(header + payload))
        assert sent == len(header + payload), sent
976637
def message(self, data, kind="info"):
        """"""
        message = pd.io.json.dumps({'kind': kind, 'data': data})
        print("Sent {0} bytes.".format(len(message)))
        self.write_message(message)
285798
def send(self, message):
        """"""
        if not message or not self.protocol or not self.protocol.transport:
            return
        if not self.can_log:
            _LOGGER.debug('Sending %s', message.strip())
        try:
            self.protocol.transport.write(message.encode())
        except OSError as exc:
            _LOGGER.error(
                'Failed writing to transport %s: %s',
                self.protocol.transport, exc)
            self.protocol.transport.close()
            self.protocol.conn_lost_callback()
114354
def send(self, message) :
        ""
        if not isinstance(message, Message) :
            raise TypeError("message must be a Message")
        #end if
        assert not self._sent, "preallocated has already been sent"
        serial = ct.c_uint()
        dbus.dbus_connection_send_preallocated(self._parent._dbobj, self._dbobj, message._dbobj, ct.byref(serial))
        self._sent = True
        return \
            serial.value
520469
def _send(self, message):
        """"""
        charset='UTF-8'
        params = {
          'action' : 'sendsms',
          'user' : self.get_username(),
          'password' : self.get_password(),
          'from' : message.from_phone,
          'to' : ",".join(message.to),
          'text' : message.body,
          'clientcharset' : charset,
          'detectcharset' : 1,
          'maxsplit': int(math.ceil(len(message.body) / 160))
        }
        
        req = urllib2.Request(SMSGLOBAL_API_URL_SENDSMS, urllib.urlencode(params))
        result_page = urllib2.urlopen(req).read()
        results = self._parse_response(result_page)
        
        if results is None:
            if not self.fail_silently:
                raise Exception("Error determining response: [" + result_page + "]")
            return False
        
        code, sendqmsgid, msgid = results
        
        if code != '0':
            if not self.fail_silently:
                raise Exception("Error sending sms: [%s], extracted results(code, sendqmsgid, msgid): [%s]" % (result_page, results))
            return False
        else:
            logger.info('SENT to: %s; sender: %s; code: %s; sendqmsgid: %s; msgid: %s; message: %s' % (
                message.to,
                message.from_phone,
                code, 
                sendqmsgid, 
                msgid,
                message.body
            ))
            return True
844315
def a_message_callback(ctx):
    """"""
    message = ctx.ctrl.after.strip().splitlines()[-1]
    ctx.device.chain.connection.emit_message(message, log_level=logging.INFO)
    return True
204487
def send(self, msg_dict):
        """"""
        message = ejson.dumps(msg_dict)
        super(DDPSocket, self).send(message)
        self._debug_log('<<<{}'.format(message))
747493
def send_message(msg)
      ws.send(msg)
    rescue => exc
      warn exc
      abort exc
    end
611008
def write(self, data, timeout):
    """"""
    if not self.remote_id:
      raise usb_exceptions.AdbStreamClosedError(
          'Cannot write() to half-opened %s', self)
    if self.closed_state != self.ClosedState.OPEN:
      raise usb_exceptions.AdbStreamClosedError(
          'Cannot write() to closed %s', self)
    elif self._expecting_okay:
      raise usb_exceptions.AdbProtocolError(
          'Previous WRTE failed, %s in unknown state', self)

    # Make sure we only have one WRTE in flight at a time, because ADB doesn't
    # identify which WRTE it is ACK'ing when it sends the OKAY message back.
    with self._write_lock:
      self._expecting_okay = True
      self._send_command('WRTE', timeout, data)
      self._read_messages_until_true(lambda: not self._expecting_okay, timeout)
338865
def _sendMsg(self, msg):
    """"""
    if not self.sock:
      self.connect()
    if not isinstance(msg, binary_type):
      msg = msg.encode("UTF-8")

    backoff = 0.001
    while True:
      try:
        self.sock.sendall(msg)
        break
      except socket.error:
        log.warning('Graphite connection error', exc_info = True)
        self.disconnect()
        time.sleep(random.uniform(0, 2.0*backoff))
        backoff = min(backoff*2.0, 5.0)
        self.connect()
807090
def send_message(self, data):
        
        # encrypt this sucka
        data = str(data)
        cmd = ord(data[0])
        if cmd in MSG_NAMES:
            cmd_name = MSG_NAMES[cmd]
        else:
            cmd_name = '$%x' % cmd
        orig_len = len(data)
        self.__write_lock.acquire()
        try:
            if self.__compress_engine_out is not None:
                data = self.__compress_engine_out(data)
            packet = self._build_packet(data)
            if self.__dump_packets:
                self._log(DEBUG, 'Write packet <%s>, length %d' % (cmd_name, orig_len))
                self._log(DEBUG, util.format_binary(packet, 'OUT: '))
            if self.__block_engine_out != None:
                out = self.__block_engine_out.encrypt(packet)
            else:
                out = packet
            # + mac
            if self.__block_engine_out != None:
                payload = struct.pack('>I', self.__sequence_number_out) + packet
                out += compute_hmac(self.__mac_key_out, payload, self.__mac_engine_out)[:self.__mac_size_out]
            self.__sequence_number_out = (self.__sequence_number_out + 1) & 0xffffffffL
            self.write_all(out)

            self.__sent_bytes += len(out)
            self.__sent_packets += 1
            if ((self.__sent_packets >= self.REKEY_PACKETS) or (self.__sent_bytes >= self.REKEY_BYTES)) \
                   and not self.__need_rekey:
                # only ask once for rekeying
                self._log(DEBUG, 'Rekeying (hit %d packets, %d bytes sent)' %
                          (self.__sent_packets, self.__sent_bytes))
                self.__received_bytes_overflow = 0
                self.__received_packets_overflow = 0
                self._trigger_rekey()
        finally:
            self.__write_lock.release()
519759
def send(dest, msg, transactionid=None):
    
    transheader = ''

    if transactionid:
        transheader = 'transaction: %s\n' % transactionid

    return "SEND\ndestination: %s\n%s\n%s\x00\n" % (dest, transheader, msg)
714138
def send(self, message) :
        ""
        if not isinstance(message, Message) :
            raise TypeError("message must be a Message")
        #end if
        serial = ct.c_uint()
        if not dbus.dbus_connection_send(self._dbobj, message._dbobj, ct.byref(serial)) :
            raise CallFailed("dbus_connection_send")
        #end if
        return \
            serial.value