code: def wait_for_pod_to_start(
      pod_name_filter: str, namespace: str, tries=60, backoff_s=5
  ) -> None:
      """Waits for a pod to have Running status.phase.
  
      More precisely, waits until there is a pod with name containing `pod_name_filter`
      and the pod has Running status.phase."""
      for i in range(tries):
          pod = get_pod(
              pod_name_filter=pod_name_filter, namespace=namespace
          )
          if not pod:
              # We didn't get a matching pod.
              continue
          pod_status = (
              subprocess.check_output(
                  [
                      "kubectl",
                      "-n",
                      namespace,
                      "get",
                      "pod",
                      pod,
                      "-o",
                      "custom-columns=POD:status.phase",
                      "--no-headers",
                  ]
              )
              .decode()
              .strip()
          )
          # "not found" is part of the kubectl output if the pod's not there.
          if "not found" in pod_status:
              raise Exception(f"Pod {pod} not found.")
          elif pod_status == "Running":
              logger.info(f"Confirmed pod {pod} is Running.")
              return
          elif i < tries - 1:
              logger.info(
                  f"Pod {pod} has status {pod_status}. Waiting for the pod to enter "
                  "Running status."
              )
              time.sleep(backoff_s)
          else:
              raise Exception(
                  f"Timed out waiting for pod {pod} to enter Running status."
              )
  
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 8 for calling a global function with example usage: wait_for_pod_to_start(pod_name_filter, namespace, tries, backoff_s) without return types