code: def get_http_session_with_retry(
      total=0,
      connect=None,
      read=None,
      redirect=None,
      status=None,
      status_forcelist=None,
      backoff_factor=0,
      backoff_max=None,
      pool_connections=None,
      pool_maxsize=None,
      config=None,
  ):
      global __disable_certificate_verification_warning
      if not all(
          isinstance(x, (int, type(None)))
          for x in (total, connect, read, redirect, status)
      ):
          raise ValueError(
              "Bad configuration. All retry count values must be null or int"
          )
  
      if status_forcelist and not all(
          isinstance(x, int) for x in status_forcelist
      ):
          raise ValueError(
              "Bad configuration. Retry status_forcelist must be null or list of ints"
          )
  
      config = config or get_config()
  
      pool_maxsize = (
          pool_maxsize
          if pool_maxsize is not None
          else config.get("api.http.pool_maxsize", 512)
      )
  
      pool_connections = (
          pool_connections
          if pool_connections is not None
          else config.get("api.http.pool_connections", 512)
      )
  
      session = SessionWithTimeout()
  
      # HACK: with python 2.7 there is a potential race condition that can cause
      # a deadlock when importing "netrc", inside the get_netrc_auth() function
      # setting 'session.trust_env' to False will make sure the `get_netrc_auth` is not called
      # see details: https://github.com/psf/requests/issues/2925
      if six.PY2:
          session.trust_env = False
  
      if backoff_max is not None:
          if "BACKOFF_MAX" in vars(Retry):
              Retry.BACKOFF_MAX = backoff_max
          else:
              Retry.DEFAULT_BACKOFF_MAX = backoff_max
  
      retry = Retry(
          total=total,
          connect=connect,
          read=read,
          redirect=redirect,
          status=status,
          status_forcelist=status_forcelist,
          backoff_factor=backoff_factor,
      )
  
      adapter = TLSv1HTTPAdapter(
          max_retries=retry,
          pool_connections=pool_connections,
          pool_maxsize=pool_maxsize,
      )
      session.mount("http://", adapter)
      session.mount("https://", adapter)
      # update verify host certificate
      session.verify = ENV_HOST_VERIFY_CERT.get(
          default=config.get("api.verify_certificate", True)
      )
      if (
          not session.verify
          and __disable_certificate_verification_warning < 2
      ):
          # show warning
          __disable_certificate_verification_warning += 1
          logging.getLogger("clearml").warning(
              msg="InsecureRequestWarning: Certificate verification is disabled! Adding "
              "certificate verification is strongly advised. See: "
              "https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings"
          )
          # make sure we only do not see the warning
          import urllib3
  
          # noinspection PyBroadException
          try:
              urllib3.disable_warnings(
                  urllib3.exceptions.InsecureRequestWarning
              )
          except Exception:
              pass
      return session
  
imports: import logging
  import ssl
  import sys
  import requests
  from requests.adapters import HTTPAdapter
  from urllib3.util import Retry
  from urllib3 import PoolManager
  import six
  from .session.defs import ENV_HOST_VERIFY_CERT
label_desc: Use image node_id 3 for calling a global function with example usage: get_http_session_with_retry(total, connect, read, redirect, status, status_forcelist, backoff_factor, backoff_max, pool_connections, pool_maxsize, config) and returns: session