code: def main():
      args = parse_args()
      if args.job_dir == "":
          args.job_dir = get_shared_folder() / "%j"
  
      # Note that the folder will depend on the job_id, to easily track experiments
      executor = submitit.AutoExecutor(
          folder=args.job_dir, slurm_max_num_timeout=30
      )
  
      # cluster setup is defined by environment variables
      num_gpus_per_node = args.ngpus
      nodes = args.nodes
      timeout_min = args.timeout
  
      executor.update_parameters(
          mem_gb=40 * num_gpus_per_node,
          gpus_per_node=num_gpus_per_node,
          tasks_per_node=num_gpus_per_node,  # one task per GPU
          cpus_per_task=10,
          nodes=nodes,
          timeout_min=timeout_min,  # max is 60 * 72
      )
  
      executor.update_parameters(name="detr")
  
      args.dist_url = get_init_file().as_uri()
      args.output_dir = args.job_dir
  
      trainer = Trainer(args)
      job = executor.submit(trainer)
  
      print("Submitted job_id:", job.job_id)
  
file_path: detr/run_with_submitit.py
imports: import argparse
  import os
  import uuid
  from pathlib import Path
  import main
  import submitit
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types