code: def debugtools(args: Optional["Namespace"] = None, **kwargs):
      kw = vars(args) if args else {}
      kw.update(kwargs)
  
      with ExitStack() as stack:
          if kw.get("pdb"):
              stack.enter_context(debug())
          if kw.get("cprofile") or kw.get("cprofile_dump"):
              stack.enter_context(profile(kw.get("cprofile_dump")))
          if kw.get("instrument") or kw.get("instrument_open"):
              stack.enter_context(
                  instrument(kw.get("instrument_open", False))
              )
          if kw.get("show_stack", False):
              stack.enter_context(show_stack())
          if kw.get("yappi"):
              path_func = _get_path_func("callgrind", "out")
              stack.enter_context(
                  yappi_profile(
                      path=path_func,
                      separate_threads=kw.get("yappi_separate_threads"),
                  )
              )
          if (
              kw.get("viztracer")
              or kw.get("viztracer_depth")
              or kw.get("viztracer_async")
          ):
              path_func = _get_path_func("viztracer", "json")
              depth = kw.get("viztracer_depth") or -1
              log_async = kw.get("viztracer_async") or False
              prof = viztracer_profile(
                  path=path_func, depth=depth, log_async=log_async
              )
              stack.enter_context(prof)
          yield
  
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 9 for calling a global function with example usage: debugtools(args) without return types