code: def wait_until_status(
      client, job_id, status_to_wait_for, timeout_seconds=20
  ):
      start = time.time()
      while time.time() - start <= timeout_seconds:
          status = client.get_job_status(job_id)
          print(f"status: {status}")
          if status in status_to_wait_for:
              return
          time.sleep(1)
      raise Exception
  
file_path: ray/dashboard/modules/job/tests/test_job_inheritance.py
imports: import time
  import json
  import sys
  import pytest
  from ray.job_submission import JobSubmissionClient, JobStatus
  from ray.cluster_utils import Cluster
  from ray.dashboard.modules.job.tests.conftest import _driver_script_path
label_desc: Use image node_id 1 for calling a global function with example usage: wait_until_status(client, job_id, status_to_wait_for, timeout_seconds) without return types