code: def wait(self):
          '''
          Wait until the ui object gone or exist.
          Usage:
          d(text="Clock").wait.gone()  # wait until it's gone.
          d(text="Settings").wait.exists() # wait until it appears.
          '''
          @param_to_property(action=["exists", "gone"])
          def _wait(action, timeout=3000):
              if timeout / 1000 + 5 > int(os.environ.get("JSONRPC_TIMEOUT", 90)):
                  http_timeout = timeout / 1000 + 5
              else:
                  http_timeout = int(os.environ.get("JSONRPC_TIMEOUT", 90))
              method = self.device.server.jsonrpc_wrap(
                  timeout=http_timeout
              ).waitUntilGone if action == "gone" else self.device.server.jsonrpc_wrap(timeout=http_timeout).waitForExists
              return method(self.selector, timeout)
          return _waif wait(self):
          '''
          Wait until the ui object gone or exist.
          Usage:
          d(text="Clock").wait.gone()  # wait until it's gone.
          d(text="Settings").wait.exists() # wait until it appears.
          '''
          @param_to_property(action=["exists", "gone"])
          def _wait(action, timeout=3000):
              if timeout / 1000 + 5 > int(os.environ.get("JSONRPC_TIMEOUT", 90)):
                  http_timeout = timeout / 1000 + 5
              else:
                  http_timeout = int(os.environ.get("JSONRPC_TIMEOUT", 90))
              method = self.device.server.jsonrpc_wrap(
                  timeout=http_timeout
              ).waitUntilGone if action == "gone" else self.device.server.jsonrpc_wrap(timeout=http_timeout).waitForExists
              return method(self.selector, timeout)
          return _wait
docs: Wait until the ui object gone or exist.
          Usage:
          d(text="Clock").wait.gone()  # wait until it's gone.
          d(text="Settings").wait.exists() # wait until it appears.