code: def shared_ray_instance():
      # Remove ray address for test ray cluster in case we have
      # lingering RAY_ADDRESS="http://127.0.0.1:8265" from previous local job
      # submissions.
      old_ray_address = os.environ.pop(
          RAY_ADDRESS_ENVIRONMENT_VARIABLE, None
      )
  
      yield create_ray_cluster()
  
      if old_ray_address is not None:
          os.environ[RAY_ADDRESS_ENVIRONMENT_VARIABLE] = old_ray_address
  
imports: import asyncio
  import os
  import signal
  import sys
  import tempfile
  import time
  import urllib.request
  from uuid import uuid4
  import psutil
  import pytest
  import ray
  from ray._private.gcs_utils import GcsAioClient
  from ray._private.ray_constants import RAY_ADDRESS_ENVIRONMENT_VARIABLE, KV_NAMESPACE_JOB, DEFAULT_DASHBOARD_AGENT_LISTEN_PORT
  from ray._private.test_utils import SignalActor, async_wait_for_condition, async_wait_for_condition_async_predicate
  from ray.dashboard.modules.job.common import JOB_ID_METADATA_KEY, JOB_NAME_METADATA_KEY
  from ray.dashboard.modules.job.job_manager import JobLogStorageClient, JobManager, JobSupervisor, generate_job_id
  from ray.dashboard.consts import RAY_JOB_ALLOW_DRIVER_ON_WORKER_NODES_ENV_VAR, RAY_JOB_START_TIMEOUT_SECONDS_ENV_VAR
  from ray.dashboard.modules.job.tests.conftest import create_ray_cluster, create_job_manager, _driver_script_path
  from ray.job_submission import JobStatus
  from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy
  from ray.tests.conftest import call_ray_start
label_desc: Use image node_id 1 for calling a global function with example usage: shared_ray_instance() without return types