code: def call_endpoints(
      host_creds,
      endpoints,
      json_body,
      response_proto,
      extra_headers=None,
  ):
      # The order that the endpoints are called in is defined by the order
      # specified in ModelRegistryService in model_registry.proto
      for i, (endpoint, method) in enumerate(endpoints):
          try:
              return call_endpoint(
                  host_creds,
                  endpoint,
                  method,
                  json_body,
                  response_proto,
                  extra_headers,
              )
          except RestException as e:
              if (
                  e.error_code != ErrorCode.Name(ENDPOINT_NOT_FOUND)
                  or i == len(endpoints) - 1
              ):
                  raise 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 9 for calling a global function with example usage: call_endpoints(host_creds, endpoints, json_body, response_proto, extra_headers) and returns: call_endpoint