code: def debug():
      try:
          yield
      except Exception:
          try:
              import ipdb as pdb  # noqa: T100
          except ImportError:
              import pdb  # type: ignore[no-redef]  # noqa: T100
          pdb.post_mortem()
  
          raise
  
file_path: dvc/dvc/_debug.py
imports: from contextlib import ExitStack, contextmanager
  from datetime import datetime
  from typing import TYPE_CHECKING, Callable, Optional, Union
label_desc: Use image node_id 5 for calling a global function with example usage: debug() without return types