code: def _get_path_func(tool: str, ext: str):
      fmt = f"{tool}.dvc-{{now:%Y%m%d}}_{{now:%H%M%S}}.{ext}"
  
      def func(now: Optional["datetime"] = None) -> str:
          return fmt.format(now=now or datetime.now())
  
      return func
  
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 8 for calling a global function with example usage: _get_path_func(tool, ext) and returns: func, fmt