def maybe_show_progress(it, show_progress, **kwargs):
 if show_progress:
  return click.progressbar(it, **kwargs)
 return CallbackManager((lambda it=it: it))

def maybe_show_progress ( it , show_progress , ** kwargs ) : if show_progress : return click . progressbar ( it , ** kwargs ) return CallbackManager ( ( lambda it = it : it ) )
optionally show a progress bar for the given iterator .