code: def _fspath_dir(path):
      if not os.path.exists(str(path)):
          return str(path)
  
      path = relpath(path)
      return os.path.join(path, "") if os.path.isdir(path) else path
  
file_path: dvc/dvc/repo/checkout.py
imports: import os
  from typing import TYPE_CHECKING, Dict, List
  from dvc.exceptions import CheckoutError, CheckoutErrorSuggestGit, DvcException, NoOutputOrStageError
  from dvc.log import logger
  from dvc.ui import ui
  from dvc.utils import relpath
  from .None import locked
label_desc: Use image node_id 1 for calling a global function with example usage: _fspath_dir(path) and returns: unknown, str