code: def create_submitit_executor(cfg: AttrDict):
      """
      Utility function to create a SLURM submitit executor, which
      is able to schedule arbitrary functions on a SLURM cluster
  
      The configuration of the executor is derived from the SLURM part
      of the VISSL configuration provided as parameter
      """
      import submitit
  
      log_folder = cfg.SLURM.LOG_FOLDER
      makedir(log_folder)
      assert g_pathmgr.exists(
          log_folder
      ), f"Specified config.SLURM.LOG_FOLDER={log_folder} doesn't exist"
      assert (
          cfg.SLURM.PARTITION
      ), "SLURM.PARTITION must be set when using SLURM"
  
      executor = submitit.AutoExecutor(folder=log_folder)
      timeout_min = cfg.SLURM.TIME_HOURS * 60 + cfg.SLURM.TIME_MINUTES
      executor.update_parameters(
          name=cfg.SLURM.NAME,
          slurm_comment=cfg.SLURM.COMMENT,
          slurm_partition=cfg.SLURM.PARTITION,
          slurm_constraint=cfg.SLURM.CONSTRAINT,
          timeout_min=timeout_min,
          nodes=cfg.DISTRIBUTED.NUM_NODES,
          cpus_per_task=cfg.SLURM.NUM_CPU_PER_PROC
          * cfg.DISTRIBUTED.NUM_PROC_PER_NODE,
          tasks_per_node=1,
          gpus_per_node=cfg.DISTRIBUTED.NUM_PROC_PER_NODE,
          mem_gb=cfg.SLURM.MEM_GB,
          slurm_additional_parameters=cfg.SLURM.ADDITIONAL_PARAMETERS,
      )
      return executor
  
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 6 for calling a global function with example usage: create_submitit_executor(cfg) and returns: executor