code: def sendMessage(self, data):
          
          opcode = BINARY
          if _check_unicode(data):
              opcode = TEXT
          self._sendMessage(False, opcode, data)
docs: Send websocket data frame to the client.
  
              If data is a unicode object then the frame is sent as Text.
              If the data is a bytearray object then the frame is sent as Binary.