code: def maybe_show_progress(
      it,
      show_progress,
      empty_char=DEFAULT_EMPTY_CHAR,
      fill_char=DEFAULT_FILL_CHAR,
      bar_template=DEFAULT_BAR_TEMPLATE,
      **kwargs,
  ):
      """Optionally show a progress bar for the given iterator.
  
      Parameters
      ----------
      it : iterable
          The underlying iterator.
      show_progress : bool
          Should progress be shown.
      **kwargs
          Forwarded to the click progress bar.
  
      Returns
      -------
      itercontext : context manager
          A context manager whose enter is the actual iterator to use.
  
      Examples
      --------
      .. code-block:: python
  
         with maybe_show_progress([1, 2, 3], True) as ns:
              for n in ns:
                  ...
      """
      if show_progress:
          kwargs["bar_template"] = bar_template
          kwargs["empty_char"] = empty_char
          kwargs["fill_char"] = fill_char
          return click.progressbar(it, **kwargs)
  
      # context manager that just return `it` when we enter it
      return CallbackManager(lambda it=it: it)
  
imports: from itertools import count
  import click
  import pandas
  from .context_tricks import CallbackManager
label_desc: Use image node_id 2 for calling a global function with example usage: maybe_show_progress(it, show_progress, empty_char, fill_char, bar_template) and returns: CallbackManager, click