class_docstr: ClearML API Session class. 
class_docstr_tok: ["ClearML","API","Session","class","."]
code: def __get_browser_token(webserver):
      # try to get the token if we are running inside a browser session (i.e. CoLab, Kaggle etc.)
      if not os.environ.get("JPY_PARENT_PID"):
          return None
  
      try:
          from google.colab import output  # noqa
          from google.colab._message import MessageError  # noqa
          from IPython import display  # noqa
  
          # must have cookie to same-origin: None for this one to work
          display.display(
              display.Javascript(
                  """
                      window._ApiKey = new Promise((resolve, reject) => {
                          const timeout = setTimeout(() => reject("Failed authenticating existing browser session"), 5000)
                          fetch("%s/api/auth.login", {
                            method: 'GET',
                            credentials: 'include'
                          })
                            .then((response) => resolve(response.json()))
                            .then((json) => {
                              clearTimeout(timeout);
                            }).catch((err) => {
                              clearTimeout(timeout);
                              reject(err);
                          });
                      });
                      """
                  % webserver.rstrip("/")
              )
          )
  
          response = output.eval_js("_ApiKey")
          if not response:
              return None
          result_code = response.get("meta", {}).get("result_code")
          token = response.get("data", {}).get("token")
      except:  # noqa
          return None
  
      if result_code != 200:
          raise ValueError(
              "Automatic authenticating failed, please login to {} and try again".format(
                  webserver
              )
          )
  
      return token
  
imports: from __future__ import print_function
  import json
  import logging
  import os
  import sys
  import types
  import weakref
  from socket import gethostname
  from time import sleep
  import jwt
  import requests
  import six
  from requests.auth import HTTPBasicAuth
  from requests.exceptions import ChunkedEncodingError, ContentDecodingError, StreamConsumedError
  from six.moves.urllib.parse import urlparse, urlunparse
  from typing import List, Optional
  from .callresult import CallResult
  from .defs import ENV_VERBOSE, ENV_HOST, ENV_ACCESS_KEY, ENV_SECRET_KEY, ENV_WEB_HOST, ENV_FILES_HOST, ENV_OFFLINE_MODE, ENV_AUTH_TOKEN, ENV_DISABLE_VAULT_SUPPORT, ENV_ENABLE_ENV_CONFIG_SECTION, ENV_ENABLE_FILES_CONFIG_SECTION, ENV_API_EXTRA_RETRY_CODES, ENV_API_DEFAULT_REQ_METHOD, ENV_FORCE_MAX_API_VERSION, ENV_IGNORE_MISSING_CONFIG, MissingConfigError
  from .request import Request, BatchRequest
  from .token_manager import TokenManager
  from ..utils import get_http_session_with_retry, urllib_log_warning_setup
  from ...backend_config import ConfigurationError
  from ...backend_config.defs import get_config_file
  from ...debugging import get_logger
  from ...debugging.log import resolve_logging_level
  from ...utilities.pyhocon import ConfigTree, ConfigFactory
  from ...version import __version__
  from ...backend_config.utils import apply_files, apply_environment
label_desc: Use image node_id 32 for calling the Session obj's underlying member method code with example usage: obj.__get_browser_token(webserver) and returns: token, None, None, None