class_docstr: ClearML API Session class. 
class_docstr_tok: ["ClearML","API","Session","class","."]
docstr: TokenManager abstract method implementation.
  Here we ignore the old token and simply obtain a new token.
docstr_tok: ["TokenManager","abstract","method","implementation",".","Here","we","ignore","the","old","token","and","simply","obtain","a","new","token","."]
code: def _do_refresh_token(self, old_token, exp=None):
      """TokenManager abstract method implementation.
      Here we ignore the old token and simply obtain a new token.
      """
      verbose = self._verbose and self._logger
      if verbose:
          self._logger.info(
              "Refreshing token from {} (access_key={}, exp={})".format(
                  self.host, self.access_key, exp
              )
          )
  
      headers = None
      # use token only once (the second time the token is already built into the http session)
      if self.__auth_token:
          headers = dict(
              Authorization="Bearer {}".format(self.__auth_token)
          )
          self.__auth_token = None
  
      auth = (
          HTTPBasicAuth(self.access_key, self.secret_key)
          if self.access_key and self.secret_key
          else None
      )
      res = None
      try:
          res = self._send_request(
              method=Request.def_method,
              service="auth",
              action="login",
              auth=auth,
              headers=headers,
              refresh_token_if_unauthorized=False,
              params={"expiration_sec": exp} if exp else {},
          )
          try:
              resp = res.json()
          except ValueError:
              resp = {}
          if res.status_code != 200:
              msg = resp.get("meta", {}).get("result_msg", res.reason)
              raise LoginError(
                  "Failed getting token (error {} from {}): {}".format(
                      res.status_code, self.host, msg
                  )
              )
          if verbose:
              self._logger.info("Received new token")
  
          # make sure we keep the token updated on the OS environment, so that child processes will have access.
          if ENV_AUTH_TOKEN.get():
              ENV_AUTH_TOKEN.set(resp["data"]["token"])
  
          return resp["data"]["token"]
      except LoginError:
          six.reraise(*sys.exc_info())
      except KeyError as ex:
          # check if this is a misconfigured api server (getting 200 without the data section)
          if res and res.status_code == 200:
              raise ValueError(
                  "It seems *api_server* is misconfigured. "
                  "Is this the ClearML API server {} ?".format(
                      self.host
                  )
              )
          else:
              raise LoginError(
                  "Response data mismatch: No 'token' in 'data' value from res, receive : {}, "
                  "exception: {}".format(res, ex)
              )
      except Exception as ex:
          raise LoginError(
              "Unrecognized Authentication Error: {} {}".format(
                  type(ex), ex
              )
          )
  
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 31 for calling the Session obj's underlying member method code with example usage: obj._do_refresh_token(old_token, exp) and returns: resp