code: def on_open(self, *args, **kwargs):
          
          self.login(self.user, self.password, api_id=1)
          self.database(api_id=1)
          self.__set_subscriptions()
          self.keepalive = threading.Thread(target=self._ping)
          self.keepalive.start()
docs: This method will be called once the websocket connection is
              established. It will
  
              * login,
              * register to the database api, and
              * subscribe to the objects defined if there is a
                callback/slot available for callbacks