code: def with_progress(items, lgrcall=None, label="Total", unit=" Files"):
      """Wrap a progress bar, with status counts, around an iterable.
  
      Parameters
      ----------
      items : some iterable
      lgrcall: callable
        Callable for logging. If not specified - lgr.info is used
      label, unit : str
          Passed to log.log_progress.
  
      Yields
      ------
      Items of it while displaying the progress
      """
      pid = "with_progress-%d" % random.randint(0, 100000)
      base_label = label
      if lgrcall is None:
          lgrcall = lgr.info
  
      label = base_label
      log_progress(
          lgrcall,
          pid,
          "%s: starting",
          label,
          total=len(items),
          label=label,
          unit=unit,
          noninteractive_level=5,
      )
  
      for item in items:
          # Since we state "processed", and actual processing might be happening
          # outside on the yielded value, we will yield before stating that
          yield item
          log_progress(
              lgrcall,
              pid,
              "%s: processed",
              base_label,
              label=label,
              update=1,
              increment=True,
              noninteractive_level=5,
          )
      log_progress(
          lgr.info, pid, "%s: done", base_label, noninteractive_level=5
      )
  
imports: from contextlib import contextmanager
  from functools import partial
  import inspect
  import logging
  import os
  import sys
  import platform
  import random
  import logging.handlers
  import warnings
  from os.path import basename, dirname
  from collections import defaultdict
  from .utils import is_interactive, optional_args
  from .support import ansi_colors
label_desc: Use image node_id 5 for calling a global function with example usage: with_progress(items, lgrcall, label, unit) without return types