This is a private message handler method.
        It handles pixy data messages.

        :param data: pixy data

        :returns: None - but update is saved in the digital pins structure
433484
async def _pixy_data(self, data):
        
        if len(self.digital_pins) < PrivateConstants.PIN_PIXY_MOSI:
            # Pixy data sent before board finished pin discovery.
            # print("Pixy data sent before board finished pin discovery.")
            return

        # strip off sysex start and end
        data = data[1:-1]
        num_blocks = data[0]  # First byte is the number of blocks.
        # Prepare the new blocks list and then used it to overwrite the pixy_blocks.
        blocks = []
        # noinspection PyDictCreation
        for i in range(num_blocks):
            block = {}
            block["signature"] = int((data[i * 12 + 2] << 7) + data[i * 12 + 1])
            block["x"] = int((data[i * 12 + 4] << 7) + data[i * 12 + 3])
            block["y"] = int((data[i * 12 + 6] << 7) + data[i * 12 + 5])
            block["width"] = int((data[i * 12 + 8] << 7) + data[i * 12 + 7])
            block["height"] = int((data[i * 12 + 10] << 7) + data[i * 12 + 9])
            block["angle"] = int((data[i * 12 + 12] << 7) + data[i * 12 + 11])
            blocks.append(block)
        self.pixy_blocks = blocks
        if self.digital_pins[PrivateConstants.PIN_PIXY_MOSI].cb:
            if self.digital_pins[PrivateConstants.PIN_PIXY_MOSI].cb_type:
                await self.digital_pins[PrivateConstants.PIN_PIXY_MOSI].cb(blocks)
            else:
                loop = self.loop
                loop.call_soon(self.digital_pins[PrivateConstants.PIN_PIXY_MOSI].cb, blocks)
288452
async def on_raw_privmsg(self, message):
        
        nick, metadata = self._parse_user(message.source)
        target, message = message.params

        self._sync_user(nick, metadata)

        await self.on_message(target, nick, message)
        if self.is_channel(target):
            await self.on_channel_message(target, nick, message)
        else:
            await self.on_private_message(target, nick, message)
586878
public MessageIDEnvelope sendMessage(Message data) throws ApiException {
        ApiResponse<MessageIDEnvelope> resp = sendMessageWithHttpInfo(data);
        return resp.getData();
    }
524430
def message(self, data):
        
        msg = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO,
                                gtk.BUTTONS_CLOSE, data)
        msg.set_resizable(1)
        msg.set_title(self.dialog_title)
        self.img.set_from_file(self.sun_icon)
        msg.set_image(self.img)
        msg.show_all()
        msg.run()
        msg.destroy()
1284981
def process_raw_data(cls, raw_data):
        """"""

        # pylint: disable=redefined-variable-type

        raw_content = raw_data.get("updateMessageStats", None)
        if raw_content is not None:
            statistics = UpdateMessageStatistics.from_raw_data(raw_content)
            raw_data["updateMessageStats"] = statistics

        raw_content = raw_data.get("routeRefreshMessageStats", None)
        if raw_content is not None:
            statistics = RouteRefreshMessageStatistics.from_raw_data(
                raw_content)
            raw_data["routeRefreshMessageStats"] = statistics

        raw_content = raw_data.get("keepAliveMessageStats", None)
        if raw_content is not None:
            statistics = KeepAliveMessageStatistics.from_raw_data(raw_content)
            raw_data["keepAliveMessageStats"] = statistics

        raw_content = raw_data.get("notificationMessageStats", None)
        if raw_content is not None:
            statistics = NotificationMessageStatistics.from_raw_data(
                raw_content)
            raw_data["notificationMessageStats"] = statistics

        raw_content = raw_data.get("openMessageStats", None)
        if raw_content is not None:
            statistics = OpenMessageStatistics.from_raw_data(raw_content)
            raw_data["openMessageStats"] = statistics

        raw_content = raw_data.get("ipv4Route", None)
        if raw_content is not None:
            statistics = IPV4Route.from_raw_data(raw_content)
            raw_data["ipv4Route"] = statistics

        raw_content = raw_data.get("ipv6Route", None)
        if raw_content is not None:
            statistics = IPV6Route.from_raw_data(raw_content)
            raw_data["ipv6Route"] = statistics

        return super(BGPPeersStatistics, cls).process_raw_data(raw_data)
1268268
def make_data(self, message):

        

        if not isinstance(message, Message):
            return message
        return message.export(self.transport_content_type)
300963
def removeNotice(self, data):
        
        LOGGER.info('Sending removenotice to Polyglot for index {}'.format(data))
        message = { 'removenotice': data }
        self.send(message)
436028
def make_message(self, data):

        

        data = self.codec.loads(data)
        msg = Message(
            data.get("data"),
            *data.get("args",[]),
            **data.get("kwargs",{})
        )
        msg.meta.update(data.get("meta"))
        self.trigger("make_message", data, msg)
        return msg
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()
1172798
def _handle_message(self, data):
        
        if data.type == MSG_SERVER_SETTINGS:
            _LOGGER.info(data.payload)
        elif data.type == MSG_SAMPLE_FORMAT:
            _LOGGER.info(data.payload)
            self._connected = True
        elif data.type == MSG_TIME:
            if not self._buffered:
                _LOGGER.info('Buffering')
        elif data.type == MSG_HEADER:
            # Push to app source and start playing.
            _LOGGER.info(data.payload.codec.decode('ascii'))
            self._source.push(data.payload.header)
            self._source.play()
        elif data.type == MSG_WIRE_CHUNK:
            # Add chunks to play queue.
            self._buffer.put(data.payload.chunk)
            if self._buffer.qsize() > BUFFER_SIZE:
                self._buffered = True
            if self._buffer.empty():
                self._buffered = False
184589
def _handle_node(self, data):
    
    next_options = self.graph[self.last_node_type]
    for node_type in next_options:
      checker, handler, *_ = node_type
      if checker(data):
        self.last_node_type = node_type
        self.handle(handler(data), node_type, data)
        return
    raise Exception("Unable to handle data: {}".format(data))
1374611
async def send(self, data: Union[bytes, str], final: bool = True):
        
        MsgType = TextMessage if isinstance(data, str) else BytesMessage
        data = MsgType(data=data, message_finished=final)
        data = self._connection.send(event=data)
        await self._sock.send_all(data)
1307596
def _pusher_connect_handler(self, data):
        
        self.channel = self.pusher.subscribe(self.pos_callback_chan)
        for listener in self.pusher_connected_listeners:
            listener(data)
351103
def __flush_data(self, data):
        
        if not data:
            return defer.succeed(None)

        assert (len(data) <= self.chunk_size)
        chunk = {"files_id": self._file["_id"],
                 "n": self._chunk_number,
                 "data": Binary(data)}

        def ok(_):
            self._chunk_number += 1
            self._position += len(data)

        # Continue writing after the insert completes (non-blocking)
        return self._chunks.insert(chunk).addCallback(ok)
119772
def feed(self, data):
        
        self._lock.acquire()
        try:
            if self._event is not None:
                self._event.set()
            self._buffer_frombytes(b(data))
            self._cv.notifyAll()
        finally:
            self._lock.release()
1179592
def handle_message(self, data):
        
        msg = json.loads(data)
        print("Dev server message: {}".format(msg))
        handler_name = 'do_{}'.format(msg['type'])
        if hasattr(self, handler_name):
            handler = getattr(self, handler_name)
            result = handler(msg)
            return {'ok': True, 'result': result}
        else:
            err = "Warning: Unhandled message: {}".format(msg)
            print(err)
            return {'ok': False, 'message': err}
279848
def send(self, data):
        
        data = bytes(data) if type(data) is not bytes else data
        self._wa_noiseprotocol.send(data)