code: def send_digest_request(json_file, path, method):
      try:
          key, secret = retrieve_remote_auth()
      except json.JSONDecodeError as e:
          log.error(
              "your key and secret aren't stored properly\n{}".format(
                  e.msg
              )
          )
          raise
      json_file["key"] = key
      session = requests.Session()
      if method == POST:
          response = session.post(
              "{}{}".format(AUTH_SERVER, path),
              headers={
                  "Authorization": 'Digest username="{0}",'
                  'password="{1}"'.format(key, secret)
              },
          )
      else:  # method == GET:
          response = session.get(
              "{}{}".format(AUTH_SERVER, path),
              headers={
                  "Authorization": 'Digest username="{0}", '
                  'password="{1}"'.format(key, secret)
              },
          )
  
      header = response.headers.get("WWW-Authenticate")
      auth_type, auth_info = header.split(None, 1)
      d = requests.utils.parse_dict_header(auth_info)
  
      a1 = key + ":" + d["realm"] + ":" + secret
      ha1 = md5(a1.encode("utf-8")).hexdigest()
      a2 = "{}:{}".format(method, path)
      ha2 = md5(a2.encode("utf-8")).hexdigest()
      a3 = ha1 + ":" + d["nonce"] + ":" + ha2
      result = md5(a3.encode("utf-8")).hexdigest()
  
      if method == POST:
          return session.post(
              "{}{}".format(AUTH_SERVER, path),
              json=json.dumps(json_file, default=convert_date),
              headers={
                  "Authorization": 'Digest username="{0}",'
                  'realm="{1}",nonce="{2}",'
                  'uri="{3}",'
                  'response="{4}",'
                  'opaque="{5}"'.format(
                      key,
                      d["realm"],
                      d["nonce"],
                      path,
                      result,
                      d["opaque"],
                  )
              },
          )
      else:  # method == GET
          return session.get(
              "{}{}".format(AUTH_SERVER, path),
              json=json.dumps(json_file, default=convert_date),
              headers={
                  "Authorization": 'Digest username="{0}", realm="{1}",'
                  'nonce="{2}",uri="{3}", '
                  'response="{4}",opaque="{5}"'.format(
                      key,
                      d["realm"],
                      d["nonce"],
                      path,
                      result,
                      d["opaque"],
                  )
              },
          )
  
file_path: catalyst/catalyst/utils/remote.py
imports: import json
  import os
  import sys
  import requests
  from hashlib import md5
  from logbook import Logger
  from catalyst.utils.remote_utils import BACKTEST_PATH, STATUS_PATH, POST, GET, EXCEPTION_LOG, convert_date, prepare_args, handle_status, is_valid_uuid
  from catalyst.exchange.utils.exchange_utils import get_remote_auth, get_remote_folder
  from catalyst.exchange.exchange_errors import RemoteAuthEmpty
label_desc: Use image node_id 4 for calling a global function with example usage: send_digest_request(json_file, path, method) and returns: session, session