def download_file(url, local_filename):
local_filename = os.path.abspath(local_filename)<EOL>path = os.path.dirname(local_filename)<EOL>if not os.path.isdir(path):<EOL><INDENT>os.makedirs(path)<EOL><DEDENT>with tqdm(unit='<STR_LIT:B>', unit_scale=True) as progress:<EOL><INDENT>def report(chunk, chunksize, total):<EOL><INDENT>progress.total = total<EOL>progress.update(chunksize)<EOL><DEDENT>return urlretrieve(url, local_filename, reporthook=report)<EOL><DEDENT>
Simple wrapper around urlretrieve that uses tqdm to display a progress
    bar of download progress