docstr: :param job_overrides: a List of List<String>, where each inner list is the arguments for one job run.
  :param initial_job_idx: Initial job idx in batch.
  :return: an array of return values from run_job with indexes corresponding to the input list indexes.
docstr_tok: [":","param","job_overrides",":","a","List","of","List","<","String",">",",","where","each","inner","list","is","the","arguments","for","one","job","run",".",":","param","initial_job_idx",":","Initial","job","idx","in","batch",".",":","return",":","an","array","of","return","values","from","run_job","with","indexes","corresponding","to","the","input","list","indexes","."]
code: def launch(
      self, job_overrides: Sequence[Sequence[str]], initial_job_idx: int
  ) -> Sequence[JobReturn]:
      """
      :param job_overrides: a List of List<String>, where each inner list is the arguments for one job run.
      :param initial_job_idx: Initial job idx in batch.
      :return: an array of return values from run_job with indexes corresponding to the input list indexes.
      """
      setup_globals()
      assert self.config is not None
      assert self.hydra_context is not None
      assert self.task_function is not None
  
      configure_log(
          self.config.hydra.hydra_logging, self.config.hydra.verbose
      )
      sweep_dir = Path(str(self.config.hydra.sweep.dir))
      sweep_dir.mkdir(parents=True, exist_ok=True)
      log.info(
          f"Example Launcher(foo={self.foo}, bar={self.bar}) is launching {len(job_overrides)} jobs locally"
      )
      log.info(f"Sweep output dir : {sweep_dir}")
      runs = []
  
      for idx, overrides in enumerate(job_overrides):
          idx = initial_job_idx + idx
          lst = " ".join(filter_overrides(overrides))
          log.info(f"\t#{idx} : {lst}")
          sweep_config = (
              self.hydra_context.config_loader.load_sweep_config(
                  self.config, list(overrides)
              )
          )
          with open_dict(sweep_config):
              # This typically coming from the underlying scheduler (SLURM_JOB_ID for instance)
              # In that case, it will not be available here because we are still in the main process.
              # but instead should be populated remotely before calling the task_function.
              sweep_config.hydra.job.id = f"job_id_for_{idx}"
              sweep_config.hydra.job.num = idx
  
          # If your launcher is executing code in a different process, it is important to restore
          # the singleton state in the new process.
          # To do this, you will likely need to serialize the singleton state along with the other
          # parameters passed to the child process.
  
          # happening on this process (executing launcher)
          state = Singleton.get_state()
  
          # happening on the spawned process (executing task_function in run_job)
          Singleton.set_state(state)
  
          ret = run_job(
              hydra_context=self.hydra_context,
              task_function=self.task_function,
              config=sweep_config,
              job_dir_key="hydra.sweep.dir",
              job_subdir_key="hydra.sweep.subdir",
          )
          runs.append(ret)
          # reconfigure the logging subsystem for Hydra as the run_job call configured it for the Job.
          # This is needed for launchers that calls run_job in the same process and not spawn a new one.
          configure_log(
              self.config.hydra.hydra_logging, self.config.hydra.verbose
          )
      return runs
  
file_path: hydra/examples/plugins/example_launcher_plugin/hydra_plugins/example_launcher_plugin/example_launcher.py
imports: from dataclasses import dataclass
  import logging
  from pathlib import Path
  from typing import Optional, Sequence
  from hydra.types import HydraContext
  from hydra.core.config_store import ConfigStore
  from hydra.core.singleton import Singleton
  from hydra.core.utils import JobReturn, configure_log, filter_overrides, run_job, setup_globals
  from hydra.plugins.launcher import Launcher
  from hydra.types import TaskFunction
  from omegaconf import DictConfig, open_dict
label_desc: Use image node_id 3 for calling the ExampleLauncher obj's underlying member method code with example usage: obj.launch(job_overrides, initial_job_idx) and returns: runs