Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def progress_bar() -> Iterator[Progress]:
progress_console = console
if HIDE_PROGRESSBAR:
progress_console = Console(file=open(os.devnull, 'w'))
with Progress(TextColumn("[bold blue]{task.description}", justify="right"),
BarColumn(bar_width=None),
"[progress.percentage]{task.percentage:>3.1f}%",
TimeRemainingColumn(),
refresh_per_second=4,
console=progress_console) as progress:
yield progress