Quantumbraid's picture
download
raw
839 Bytes
from tqdm import tqdm
import time
class ToolkitProgressBar(tqdm):
def __init__(self, *args, **kwargs):
# high EMA alpha so the rate/ETA responds within a few steps
# (tqdm default of 0.3 takes ~10 steps to wash out old samples)
kwargs.setdefault('smoothing', 0.7)
super().__init__(*args, **kwargs)
self.paused = False
self.last_time = self._time()
def pause(self):
if not self.paused:
self.paused = True
self.last_time = self._time()
def unpause(self):
if self.paused:
self.paused = False
cur_t = self._time()
self.start_t += cur_t - self.last_time
self.last_print_t = cur_t
def update(self, *args, **kwargs):
if not self.paused:
super().update(*args, **kwargs)

Xet Storage Details

Size:
839 Bytes
·
Xet hash:
8bf4d70247da4bffe76b86e7735825086e81f4d59d34498d781718aabdc0170c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.