code: def process_save_path(
      path,
      resume: Optional[bool] = False,
      raise_if_exist: Optional[bool] = True,
  ):
      """
      Convert the provided path to an absolute path and check whether it is valid.
      If a path exists, either raise error or return None.
      A None path can be identified by the `setup_outputdir` to generate a random path.
  
      Parameters
      ----------
      path
          A provided path.
      resume
          Whether this is a path to resume training.
      raise_if_exist
          Whether to raise error if the path exists.
  
      Returns
      -------
      A complete and verified path or None.
      """
      path = os.path.abspath(os.path.expanduser(path))
      if resume:
          assert os.path.isfile(os.path.join(path, LAST_CHECKPOINT)), (
              f"Trying to resume training from '{path}'. "
              f"However, it does not contain the last checkpoint file: '{LAST_CHECKPOINT}'. "
              "Are you using a correct path?"
          )
      elif os.path.isdir(path) and len(os.listdir(path)) > 0:
          if raise_if_exist:
              raise ValueError(
                  f"Path {path} already exists."
                  "Specify a new path to avoid accidentally overwriting a saved predictor."
              )
          else:
              logger.warning(
                  "A new predictor save path is created. "
                  "This is to prevent you to overwrite previous predictor saved here. "
                  "You could check current save path at predictor._save_path. "
                  "If you still want to use this path, set resume=True"
              )
              path = None
  
      return path
  
file_path: autogluon/multimodal/src/autogluon/multimodal/utils/save.py
imports: import logging
  import os
  from typing import Dict, List, Optional, Tuple, Union
  from autogluon.common.utils.utils import setup_outputdir
  from ..constants import AUTOMM, HF_MODELS, LAST_CHECKPOINT
  from ..data import TextProcessor
label_desc: Use image node_id 2 for calling a global function with example usage: process_save_path(path, resume, raise_if_exist) and returns: path