Ejemplo n.º 1
0
 def query_with_timeout(self, timeout=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():
         if util._is_kaggle():
             raise CommError(
                 "To use W&B in kaggle you must enable internet in the settings panel on the right."  # noqa: E501
             )
         # 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", "{}"))
Ejemplo n.º 2
0
 def _kaggle(self):
     return util._is_kaggle()
Ejemplo n.º 3
0
 def _kaggle(self) -> bool:
     return util._is_kaggle()
Ejemplo n.º 4
0
 def _kaggle(self) -> bool:
     is_kaggle = util._is_kaggle()
     if wandb.TYPE_CHECKING and TYPE_CHECKING:
         assert isinstance(is_kaggle, bool)
     return is_kaggle