code: def setup_outputdir(
      path, warn_if_exist=True, create_dir=True, path_suffix=None
  ):
      if path:
          assert isinstance(
              path, (str, Path)
          ), f"Only str and pathlib.Path types are supported for path, got {path} of type {type(path)}."
      if path_suffix is None:
          path_suffix = ""
      if path_suffix and path_suffix[-1] == os.path.sep:
          path_suffix = path_suffix[:-1]
      if path is not None:
          path = f"{path}{path_suffix}"
      if path is None:
          utcnow = datetime.utcnow()
          timestamp = utcnow.strftime("%Y%m%d_%H%M%S")
          path = os.path.join(
              "AutogluonModels", f"ag-{timestamp}{path_suffix}"
          )
          for i in range(1, 1000):
              try:
                  if create_dir:
                      os.makedirs(path, exist_ok=False)
                      break
                  else:
                      if os.path.isdir(path):
                          raise FileExistsError
                      break
              except FileExistsError:
                  path = os.path.join(
                      "AutogluonModels",
                      f"ag-{timestamp}-{i:03d}{path_suffix}",
                  )
          else:
              raise RuntimeError(
                  "more than 1000 jobs launched in the same second"
              )
          logger.log(
              25,
              f'No path specified. Models will be saved in: "{path}"',
          )
      elif warn_if_exist:
          try:
              if create_dir:
                  os.makedirs(path, exist_ok=False)
              elif os.path.isdir(path):
                  raise FileExistsError
          except FileExistsError:
              logger.warning(
                  f'Warning: path already exists! This predictor may overwrite an existing predictor! path="{path}"'
              )
      path = os.path.expanduser(
          path
      )  # replace ~ with absolute path if it exists
      return path
  
file_path: autogluon/common/src/autogluon/common/utils/utils.py
imports: import logging
  import os
  import platform
  import sys
  from datetime import datetime
  from hashlib import md5
  from pathlib import Path
  from typing import Any, Dict, Optional
  import numpy
  import pandas
  from ..version import __version__
label_desc: Use image node_id 1 for calling a global function with example usage: setup_outputdir(path, warn_if_exist, create_dir, path_suffix) and returns: path