code: def gen_bar_updater(pbar: tqdm) -> Callable[[int, int, int], None]:
      def bar_update(
          count: int, block_size: int, total_size: int
      ) -> None:
          if pbar.total is None and total_size:
              pbar.total = total_size
          progress_bytes = count * block_size
          pbar.update(progress_bytes - pbar.n)
  
      return bar_update
  
file_path: PyTorch-BigGraph/torchbiggraph/converters/utils.py
imports: import gzip
  import shutil
  import tarfile
  from pathlib import Path
  from typing import Callable, Optional
  from urllib.parse import urlparse
  from urllib.request import urlretrieve
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: gen_bar_updater(pbar) and returns: bar_update