code: def query_with_timeout(
      self, timeout: Union[int, float, None] = None
  ) -> None:
      if self._settings and self._settings._disable_viewer:
          return
      timeout = timeout or 5
      async_viewer = util.async_call(
          self._api.viewer_server_info, timeout=timeout
      )
      try:
          viewer_tuple, viewer_thread = async_viewer()
      except Exception:
          # TODO: currently a bare exception as lots can happen, we should classify
          self._error_network = True
          return
      if viewer_thread.is_alive():
          # this is likely a DNS hang
          self._error_network = True
          return
      self._error_network = False
      # TODO(jhr): should we kill the thread?
      self._viewer, self._serverinfo = viewer_tuple
      self._flags = json.loads(self._viewer.get("flags", "{}"))
  
file_path: wandb/wandb/sdk/lib/server.py
imports: import json
  from typing import TYPE_CHECKING, Any, Dict, Optional, Union
  from wandb import util
  from wandb.apis import InternalApi
label_desc: Use image node_id 2 for calling the Server obj's underlying member method code with example usage: obj.query_with_timeout(timeout) without return types