code: def download_file_with_progress(
      url_base, sub_dir, model_name, file_name
  ):
      """General utility for incrementally downloading files from the internet
      with progress bar
      from url_base / sub_dir / filename
      to local file system sub_dir / filename
  
      Parameters
      ----------
      file_name : str
          name of file to get e.g. "hparams.json"
      sub_dir: str
          subdirectory inside which to get and copy locally eg. "models/124M"
          no trailing slash
      url_base : str
          Start of URL location specifying server and any base directories no
          trailing slash
          e.g. "https://storage.googleapis.com/gpt-2"
      """
  
      # set to download 1MB at a time. This could be much larger with no issue
      DOWNLOAD_CHUNK_SIZE = 1024 * 1024
      r = requests.get(
          url_base + "/models/" + model_name + "/" + file_name,
          stream=True,
      )
      with open(os.path.join(sub_dir, file_name), "wb") as f:
          file_size = int(r.headers["content-length"])
          with tqdm(
              ncols=100,
              desc="Fetching " + file_name,
              total=file_size,
              unit_scale=True,
          ) as pbar:
              for chunk in r.iter_content(
                  chunk_size=DOWNLOAD_CHUNK_SIZE
              ):
                  f.write(chunk)
                  pbar.update(DOWNLOAD_CHUNK_SIZE)
  
imports: import tarfile
  import os
  import json
  import requests
  import sys
  import shutil
  import re
  from tqdm import tqdm, trange
  import numpy
  import tensorflow
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python.client import device_lib
  import time
  from datetime import datetime
  import csv
  import argparse
  from sys import exit
  import codecs
  from gpt_2_simple.src import model, sample, encoder, memory_saving_gradients
  from gpt_2_simple.src.load_dataset import load_dataset, Sampler
  from gpt_2_simple.src.accumulate import AccumulatingOptimizer
label_desc: Use image node_id 1 for calling a global function with example usage: download_file_with_progress(url_base, sub_dir, model_name, file_name) without return types