code: def send(self, data):
          
          if not self._ws_connection:
              raise RuntimeError('Web socket connection is closed.')
  
          self._ws_connection.write_message(json.dumps(data))
docs: Send message to the server
          :param str data: message.