code: def cleanup_dir(dir):
      """
      Utility for deleting a directory. Useful for cleaning the storage space
      that contains various training artifacts like checkpoints, data etc.
      """
      if os.path.exists(dir):
          logging.info(f"Deleting directory: {dir}")
          shutil.rmtree(dir)
      logging.info(f"Deleted contents of directory: {dir}")
  
imports: import json
  import logging
  import os
  import pickle
  import re
  import shutil
  import time
  from urllib.parse import urlparse
  import numpy
  import pandas
  import yaml
  from iopath.common.download import download
  from iopath.common.file_io import file_lock, g_pathmgr
  from vissl.utils.slurm import get_slurm_dir
label_desc: Use image node_id 8 for calling a global function with example usage: cleanup_dir(dir) without return types