INNER CODE UNIT · Python
update_to
NirantK/NLP_Quickbook · Part-08 Web Deployments/utils.py:12
def update_to(self, b=1, bsize=1, tsize=None):
if tsize is not None:
self.total = tsize
self.update(b * bsize - self.n)
def get_data(url, filename):
"""
Download data if the filename does not exist already
Uses Tqdm to show download progress
"""
if not os.path.exists(filename):
dirname = os.path.dirname(filename)
if not os.path.exists(dirname):
os.makedirs(dirname)
with TqdmUpTo(