code: def get_local_path(input_file, dest_dir):
      """
      If user specified copying data to a local directory,
      get the local path where the data files were copied.
  
      - If input_file is just a file, we return the dest_dir/filename
      - If the intput_file is a directory, then we check if the
        environemt is SLURM and use slurm_dir or otherwise dest_dir
        to look up copy_complete file is available.
        If available, we return the directory.
      - If both above fail, we return the input_file as is.
      """
      out = ""
      if g_pathmgr.isfile(input_file):
          out = os.path.join(dest_dir, os.path.basename(input_file))
      elif g_pathmgr.isdir(input_file):
          data_name = input_file.strip("/").split("/")[-1]
          if "SLURM_JOBID" in os.environ:
              dest_dir = get_slurm_dir(dest_dir)
          dest_dir = os.path.join(dest_dir, data_name)
          complete_flag = os.path.join(dest_dir, "copy_complete")
          if g_pathmgr.isfile(complete_flag):
              out = dest_dir
      if g_pathmgr.exists(out):
          return out
      else:
          return input_file
  
imports: import json
  import logging
  import os
  from typing import List
  import numpy
  from iopath.common.file_io import g_pathmgr
  from vissl.data.datasets import get_coco_imgs_labels_info, get_voc_images_labels_info
  from vissl.utils.misc import get_json_data_catalog_file
  from vissl.utils.slurm import get_slurm_dir
label_desc: Use image node_id 1 for calling a global function with example usage: get_local_path(input_file, dest_dir) and returns: out, input_file