code: def warm_up_one_cluster(
      num_warmup_iterations: int,
      http_host: str,
      http_port: str,
      endpoint: str,
      nonblocking: bool = False,
  ) -> None:
      # Specifying a low timeout effectively makes requests.get() nonblocking
      timeout = 0.0001 if nonblocking else None
      logger.info(f"Warming up {endpoint} ..")
      for _ in range(num_warmup_iterations):
          try:
              resp = requests.get(
                  f"http://{http_host}:{http_port}/{endpoint}",
                  timeout=timeout,
              ).text
              logger.info(resp)
          except requests.exceptions.ReadTimeout:
              # This exception only gets raised if a timeout is specified in the
              # requests.get() call.
              logger.info("Issued nonblocking HTTP request.")
  
      return endpoint
  
file_path: ray/release/serve_tests/workloads/serve_test_cluster_utils.py
imports: import logging
  import ray
  import requests
  from ray._private.test_utils import monitor_memory_usage
  from ray.cluster_utils import Cluster
  from ray import serve
  from ray.serve.config import DeploymentMode
  from ray.serve.context import _get_global_client
label_desc: Use image node_id 3 for calling a global function with example usage: warm_up_one_cluster(num_warmup_iterations, http_host, http_port, endpoint, nonblocking) and returns: endpoint