code: def download_progress(to: "Output") -> Iterator[Callable[[int], Any]]:
      from dvc.ui import ui
      from dvc.ui._rich_progress import DbDownloadProgress
  
      with log_durations(
          logger.debug, f"Saving to {to}"
      ), DbDownloadProgress(
          console=ui.error_console,
      ) as progress:
          task = progress.add_task("Saving", total=None, output=to)
          yield lambda n: progress.advance(task, advance=n)
          progress.update(task, description="Saved", total=0)
  
imports: from contextlib import contextmanager
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, Optional
  from funcy import compact, log_durations
  from dvc.exceptions import DvcException
  from dvc.log import logger
  from .base import Dependency
label_desc: Use image node_id 1 for calling a global function with example usage: download_progress(to) without return types