code: def wait_for_pods(
      goal_num_pods: int, namespace: str, tries=60, backoff_s=5
  ) -> None:
      """Wait for the number of pods in the `namespace` to be exactly `num_pods`.
  
      Raise an exception after exceeding `tries` attempts with `backoff_s` second waits.
      """
      for i in range(tries):
          cur_num_pods = _get_num_pods(namespace)
          if cur_num_pods == goal_num_pods:
              logger.info(
                  f"Confirmed {goal_num_pods} pod(s) in namespace {namespace}."
              )
              return
          elif i < tries - 1:
              logger.info(
                  f"The number of pods in namespace {namespace} is {cur_num_pods}."
                  f" Waiting until the number of pods is {goal_num_pods}."
                  f"{get_pod_names(namespace)}"
              )
              time.sleep(backoff_s)
          else:
              raise Exception(
                  f"Failed to scale to {goal_num_pods} pod(s) in namespace {namespace}."
              )
  
imports: import atexit
  import contextlib
  import logging
  import pathlib
  import subprocess
  import tempfile
  import time
  from typing import Any, Dict, Generator, List, Optional
  import yaml
  import os
  import ray
  from ray.job_submission import JobStatus, JobSubmissionClient
label_desc: Use image node_id 5 for calling a global function with example usage: wait_for_pods(goal_num_pods, namespace, tries, backoff_s) without return types