code: def _check_job(
      client: JobSubmissionClient,
      job_id: str,
      status: JobStatus,
      timeout: int = 10,
  ) -> bool:
      res_status = client.get_job_status(job_id)
      assert res_status == status
      return True
  
imports: import logging
  import os
  import ray
  import requests
  import shutil
  import sys
  import tempfile
  import time
  from pathlib import Path
  from functools import partial
  import pytest
  import yaml
  from ray._private.utils import get_or_create_event_loop
  from ray._private.runtime_env.working_dir import upload_working_dir_if_needed
  from ray._private.runtime_env.py_modules import upload_py_modules_if_needed
  from ray._private.ray_constants import DEFAULT_DASHBOARD_AGENT_LISTEN_PORT
  from ray._private.test_utils import chdir, format_web_url, wait_until_server_available, wait_for_condition, run_string_as_driver_nonblocking, get_current_unused_port, async_wait_for_condition_async_predicate
  from ray.dashboard.modules.job.common import JobSubmitRequest, validate_request_type, JOB_ACTOR_NAME_TEMPLATE, SUPERVISOR_ACTOR_RAY_NAMESPACE
  from ray.dashboard.tests.conftest import *
  from ray.runtime_env.runtime_env import RuntimeEnv, RuntimeEnvConfig
  from ray.util.state import get_node, list_nodes, list_actors
  from ray.job_submission import JobStatus, JobSubmissionClient
  from ray.tests.conftest import _ray_start
  from ray.dashboard.modules.job.job_head import JobAgentSubmissionClient
label_desc: Use image node_id 4 for calling a global function with example usage: _check_job(client, job_id, status, timeout) and returns: True