This is a private message handler method.
        It is a message handler for Digital Messages.

        :param data: digital message

        :returns: None - but update is saved in pins structure
973031
async def _digital_message(self, data):
        
        port = data[0]
        port_data = (data[PrivateConstants.MSB] << 7) + \
                    data[PrivateConstants.LSB]
        pin = port * 8
        for pin in range(pin, min(pin + 8, len(self.digital_pins))):
            # get pin value
            value = port_data & 0x01

            # set the current value in the pin structure
            self.digital_pins[pin].current_value = value

            # append pin number, pin value, and pin type to return value and return as a list
            message = [pin, value, Constants.INPUT]

            if self.digital_pins[pin].cb:
                if self.digital_pins[pin].cb_type:
                    await self.digital_pins[pin].cb(message)
                else:
                    # self.digital_pins[pin].cb(data)
                    loop = self.loop
                    loop.call_soon(self.digital_pins[pin].cb, message)

                # is there a latch entry for this pin?
                key = 'D' + str(pin)
                if key in self.latch_map:
                    await self._check_latch_data(key, port_data & 0x01)
            port_data >>= 1
177195
def _handle_eio_message(self, sid, data):
        """"""
        if sid in self._binary_packet:
            pkt = self._binary_packet[sid]
            if pkt.add_attachment(data):
                del self._binary_packet[sid]
                if pkt.packet_type == packet.BINARY_EVENT:
                    self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)
                else:
                    self._handle_ack(sid, pkt.namespace, pkt.id, pkt.data)
        else:
            pkt = packet.Packet(encoded_packet=data)
            if pkt.packet_type == packet.CONNECT:
                self._handle_connect(sid, pkt.namespace)
            elif pkt.packet_type == packet.DISCONNECT:
                self._handle_disconnect(sid, pkt.namespace)
            elif pkt.packet_type == packet.EVENT:
                self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)
            elif pkt.packet_type == packet.ACK:
                self._handle_ack(sid, pkt.namespace, pkt.id, pkt.data)
            elif pkt.packet_type == packet.BINARY_EVENT or \
                    pkt.packet_type == packet.BINARY_ACK:
                self._binary_packet[sid] = pkt
            elif pkt.packet_type == packet.ERROR:
                raise ValueError('Unexpected ERROR packet.')
            else:
                raise ValueError('Unknown packet type.')
334827
def _handle_rfx(self, data):
        
        msg = RFMessage(data)

        self.on_rfx_message(message=msg)

        return msg
560766
private void callOnTextMessage(byte[] data)
    {
        if (mWebSocket.isDirectTextMessage())
        {
            mWebSocket.getListenerManager().callOnTextMessage(data);
            return;
        }

        try
        {
            // Interpret the byte array as a string.
            // OutOfMemoryError may happen when the size of data is too big.
            String message = Misc.toStringUTF8(data);

            // Call onTextMessage() method of the listeners.
            callOnTextMessage(message);
        }
        catch (Throwable t)
        {
            // Failed to convert payload data into a string.
            WebSocketException wse = new WebSocketException(
                WebSocketError.TEXT_MESSAGE_CONSTRUCTION_ERROR,
                "Failed to convert payload data into a string: " + t.getMessage(), t);

            // Notify the listeners that text message construction failed.
            callOnError(wse);
            callOnTextMessageError(wse, data);
        }
    }
371384
def on_privmsg(self, connection, event):
        
        sender = self.get_nick(event.source)
        message = event.arguments[0]
        
        if sender == 'NickServ':
            logging.info("Got message from NickServ: %s", message)
            if "password" in message.lower():
                connection.privmsg("NickServ", "pass")
            else:
                connection.join('#cohorte')
            
            return

        self.handle_message(connection, sender, sender, message)
1179865
def update(self, data):
        
        try:
            self.verifier.update(data)
        except TypeError:
            log.error("Invalid data: {} ({})".format(type(data), data))
            raise
279848
def send(self, data):
        
        data = bytes(data) if type(data) is not bytes else data
        self._wa_noiseprotocol.send(data)
639417
def Update(self, data):
        
        m = len(data)
        self.params[:m] += data
1319829
function handleReply(inboundMessage, data) {
  if (data.reply) {
    _.merge(data.content.headers, Transport.getReplyHeaders(inboundMessage));

    data.content.subject = Transport.getReplySubject(inboundMessage);

    delete data.reply;
  }

  return data;
}
477682
async def on_data(self, data):
        
        self._receive_buffer += data

        # Schedule new timeout event.
        if self._ping_checker_handle:
            self._ping_checker_handle.cancel()

        # create a task for the ping checker
        self._ping_checker_handle = self.eventloop.create_task(
            self._perform_ping_timeout(self.PING_TIMEOUT))

        while self._has_message():
            message = self._parse_message()
            self.eventloop.create_task(self.on_raw(message))
1271891
def data(self, data):
        
        self._buffer = self._buffer + data

        while self._data_handler():
            pass
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)
1012025
def sendMessage(self, data):
      
      opcode = BINARY
      if isinstance(data, unicode):
         opcode = TEXT
      self._sendMessage(False, opcode, data)
362716
async def _analog_message(self, data):
        
        pin = data[0]
        value = (data[PrivateConstants.MSB] << 7) + data[PrivateConstants.LSB]
        # if self.analog_pins[pin].current_value != value:
        self.analog_pins[pin].current_value = value

        # append pin number, pin value, and pin type to return value and return as a list
        message = [pin, value, Constants.ANALOG]

        if self.analog_pins[pin].cb:
            if self.analog_pins[pin].cb_type:
                await self.analog_pins[pin].cb(message)
            else:
                loop = self.loop
                loop.call_soon(self.analog_pins[pin].cb, message)

        # is there a latch entry for this pin?
        key = 'A' + str(pin)
        if key in self.latch_map:
            await self._check_latch_data(key, message[1])
1178394
def analog_callback(self, data):
        
        reply = json.dumps({"method": "analog_message_reply", "params": [data[0], data[1]]})
        asyncio.ensure_future(self.websocket.send(reply))
738811
def message_text(self, m_data):
        '''
        
        '''
        if m_data.get('type') != 'message':
            raise TypeError('This is not a message')
        # Edited messages have text in message
        _text = m_data.get('text', None) or m_data.get('message', {}).get('text', None)
        try:
            log.info('Message is %s', _text)  # this can violate the ascii codec
        except UnicodeEncodeError as uee:
            log.warning('Got a message that I could not log. The reason is: %s', uee)

        # Convert UTF to string
        _text = salt.utils.json.dumps(_text)
        _text = salt.utils.yaml.safe_load(_text)

        if not _text:
            raise ValueError('_text has no value')
        return _text
831299
def _non_connect_send_msg(self, msg_code, data):
        
        try:
            self._socket.sendall(self._encode_msg(msg_code, data))
        except (IOError, socket.error) as e:
            if e.errno == errno.EPIPE:
                raise ConnectionClosed(e)
            else:
                raise