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():
return ProgressBar()
"""
if generator is None:
return self
if self.enabled:
return tqdm(generator, total=total)
return generator
def __enter__(self):
self._previous_value = self.enabled
self.enabled = True
def __exit__(self, *args):
self.enabled = self._previous_value
progress = ProgressBar()