code: def _run_job(
      hydra_context: HydraContext,
      sweep_config: DictConfig,
      task_function: TaskFunction,
      singleton_state: Dict[Any, Any],
  ) -> JobReturn:
      setup_globals()
      Singleton.set_state(singleton_state)
      HydraConfig.instance().set_config(sweep_config)
      return run_job(
          hydra_context=hydra_context,
          task_function=task_function,
          config=sweep_config,
          job_dir_key="hydra.sweep.dir",
          job_subdir_key="hydra.sweep.subdir",
      )
  
file_path: hydra/plugins/hydra_ray_launcher/hydra_plugins/hydra_ray_launcher/_launcher_util.py
imports: import logging
  import os
  from contextlib import contextmanager
  from subprocess import PIPE, Popen
  from typing import Any, Dict, Generator, List, Tuple
  import ray
  from hydra.core.hydra_config import HydraConfig
  from hydra.core.singleton import Singleton
  from hydra.core.utils import JobReturn, run_job, setup_globals
  from hydra.types import HydraContext, TaskFunction
  from omegaconf import DictConfig, OmegaConf
label_desc: Use image node_id 2 for calling a global function with example usage: _run_job(hydra_context, sweep_config, task_function, singleton_state) and returns: run_job