code: def get_slurm_dir(input_dir: str):
      """
      If using SLURM, we use the environment variable "SLURM_JOBID" to
      uniquely identify the current training and append the id to the
      input directory. This could be used to store any training artifacts
      specific to this training run.
      """
      output_dir = input_dir
      if "SLURM_JOBID" in os.environ:
          output_dir = f"{input_dir}/{os.environ['SLURM_JOBID']}"
      return output_dir
  
imports: import logging
  import os
label_desc: Use image node_id 2 for calling a global function with example usage: get_slurm_dir(input_dir) and returns: output_dir