code: def http_request(
      host_creds,
      endpoint,
      method,
      max_retries=None,
      backoff_factor=None,
      backoff_jitter=None,
      extra_headers=None,
      retry_codes=_TRANSIENT_FAILURE_RESPONSE_CODES,
      timeout=None,
      raise_on_status=True,
      **kwargs,
  ):
      """Makes an HTTP request with the specified method to the specified hostname/endpoint. Transient
      errors such as Rate-limited (429), service unavailable (503) and internal error (500) are
      retried with an exponential back off with backoff_factor * (1, 2, 4, ... seconds).
      The function parses the API response (assumed to be JSON) into a Python object and returns it.
  
      Args:
          host_creds: A :py:class:`mlflow.rest_utils.MlflowHostCreds` object containing
              hostname and optional authentication.
          endpoint: A string for service endpoint, e.g. "/path/to/object".
          method: A string indicating the method to use, e.g. "GET", "POST", "PUT".
          max_retries: Maximum number of retries before throwing an exception.
          backoff_factor: A time factor for exponential backoff. e.g. value 5 means the HTTP
              request will be retried with interval 5, 10, 20... seconds. A value of 0 turns off the
              exponential backoff.
          backoff_jitter: A random jitter to add to the backoff interval.
          extra_headers: A dict of HTTP header name-value pairs to be included in the request.
          retry_codes: A list of HTTP response error codes that qualifies for retry.
          timeout: Wait for timeout seconds for response from remote server for connect and
              read request.
          raise_on_status: Whether to raise an exception, or return a response, if status falls
              in retry_codes range and retries have been exhausted.
          kwargs: Additional keyword arguments to pass to `requests.Session.request()`
  
      Returns:
          requests.Response object.
      """
      max_retries = (
          MLFLOW_HTTP_REQUEST_MAX_RETRIES.get()
          if max_retries is None
          else max_retries
      )
      backoff_factor = (
          MLFLOW_HTTP_REQUEST_BACKOFF_FACTOR.get()
          if backoff_factor is None
          else backoff_factor
      )
      backoff_jitter = (
          MLFLOW_HTTP_REQUEST_BACKOFF_JITTER.get()
          if backoff_jitter is None
          else backoff_jitter
      )
      timeout = (
          MLFLOW_HTTP_REQUEST_TIMEOUT.get()
          if timeout is None
          else timeout
      )
      hostname = host_creds.host
      auth_str = None
      if host_creds.username and host_creds.password:
          basic_auth_str = (
              f"{host_creds.username}:{host_creds.password}".encode()
          )
          auth_str = "Basic " + base64.standard_b64encode(
              basic_auth_str
          ).decode("utf-8")
      elif host_creds.token:
          auth_str = f"Bearer {host_creds.token}"
  
      from mlflow.tracking.request_header.registry import (
          resolve_request_headers,
      )
  
      headers = dict(**resolve_request_headers())
      if extra_headers:
          headers = dict(**headers, **extra_headers)
  
      if auth_str:
          headers["Authorization"] = auth_str
  
      if host_creds.client_cert_path is not None:
          kwargs["cert"] = host_creds.client_cert_path
  
      if host_creds.aws_sigv4:
          # will overwrite the Authorization header
          from requests_auth_aws_sigv4 import AWSSigV4
  
          kwargs["auth"] = AWSSigV4("execute-api")
      elif host_creds.auth:
          from mlflow.tracking.request_auth.registry import fetch_auth
  
          kwargs["auth"] = fetch_auth(host_creds.auth)
  
      cleaned_hostname = strip_suffix(hostname, "/")
      url = f"{cleaned_hostname}{endpoint}"
      try:
          return _get_http_response_with_retries(
              method,
              url,
              max_retries,
              backoff_factor,
              backoff_jitter,
              retry_codes,
              raise_on_status,
              headers=headers,
              verify=host_creds.verify,
              timeout=timeout,
              **kwargs,
          )
      except requests.exceptions.Timeout as to:
          raise MlflowException(
              f"API request to {url} failed with timeout exception {to}."
              " To increase the timeout, set the environment variable "
              f"{MLFLOW_HTTP_REQUEST_TIMEOUT!s} to a larger value."
          ) from to
      except requests.exceptions.InvalidURL as iu:
          raise InvalidUrlException(f"Invalid url: {url}") from iu
      except Exception as e:
          raise MlflowException(
              f"API request to {url} failed with exception {e}"
          )
  
imports: import base64
  import json
  import requests
  from mlflow.environment_variables import MLFLOW_HTTP_REQUEST_BACKOFF_FACTOR, MLFLOW_HTTP_REQUEST_BACKOFF_JITTER, MLFLOW_HTTP_REQUEST_MAX_RETRIES, MLFLOW_HTTP_REQUEST_TIMEOUT
  from mlflow.exceptions import InvalidUrlException, MlflowException, RestException, get_error_code
  from mlflow.protos import databricks_pb2
  from mlflow.protos.databricks_pb2 import ENDPOINT_NOT_FOUND, INVALID_PARAMETER_VALUE, ErrorCode
  from mlflow.utils.proto_json_utils import parse_dict
  from mlflow.utils.request_utils import _TRANSIENT_FAILURE_RESPONSE_CODES, _get_http_response_with_retries, augmented_raise_for_status, cloud_storage_http_request
  from mlflow.utils.string_utils import strip_suffix
label_desc: Use image node_id 1 for calling a global function with example usage: http_request(host_creds, endpoint, method, max_retries, backoff_factor, backoff_jitter, extra_headers, retry_codes, timeout, raise_on_status) and returns: _get_http_response_with_retries