code: def launch_distributed_on_slurm(cfg: AttrDict, engine_name: str):
      """
      Launch a distributed training on SLURM, allocating the nodes and GPUs as described in
      the configuration, and calls the function "launch_on_local_node" appropriately on each
      of the nodes.
  
      Args:
          cfg (AttrDict): the configuration of the experiment
          engine_name (str): the name of the engine to run (train or extract_features)
      """
      executor = create_submitit_executor(cfg)
      trainer = _ResumableSlurmJob(engine_name=engine_name, config=cfg)
      job = executor.submit(trainer)
      print(f"SUBMITTED: {job.job_id}")
      return job
  
imports: import logging
  import tempfile
  from typing import Any, Callable, List
  import torch
  from iopath.common.file_io import g_pathmgr
  from vissl.config import AttrDict
  from vissl.data.dataset_catalog import get_data_files
  from vissl.engines import run_engine
  from vissl.hooks import ClassyHook, default_hook_generator
  from vissl.utils.checkpoint import get_checkpoint_folder, get_resume_checkpoint, is_training_finished
  from vissl.utils.env import set_env_vars
  from vissl.utils.io import cleanup_dir, copy_data_to_local, makedir
  from vissl.utils.logger import setup_logging, shutdown_logging
  from vissl.utils.misc import get_dist_run_id
  from vissl.utils.slurm import get_node_id
label_desc: Use image node_id 7 for calling a global function with example usage: launch_distributed_on_slurm(cfg, engine_name) and returns: job