code: def maybe_download(
      url, filename=None, work_directory=".", expected_bytes=None
  ):
      """Download a file if it is not already downloaded.
      :param url: URL of the file to download
      :type url: string
      :param filename: what the downloaded file will be named
      :type filename: string, optional
      :param work_directory: where the file will be downloaded to
      :type work_directory: string, optional
      :param expected_bytes: expected file size in bytes
      :type expected_btes: int
      :raises IOError
      :return: filepath to the downloaded file
      :rtype: string
      """
      if filename is None:
          filename = url.split("/")[-1]
      os.makedirs(work_directory, exist_ok=True)
      filepath = os.path.join(work_directory, filename)
      if not os.path.exists(filepath):
          if not os.path.isdir(work_directory):
              os.makedirs(work_directory)
          r = requests.get(url, stream=True)
          total_size = int(r.headers.get("content-length", 0))
          block_size = 1024
          num_iterables = math.ceil(total_size / block_size)
  
          with open(filepath, "wb") as file:
              for data in tqdm(
                  r.iter_content(block_size),
                  total=num_iterables,
                  unit="KB",
                  unit_scale=True,
              ):
                  file.write(data)
      else:
          log.debug("File {} already downloaded".format(filepath))
      if expected_bytes is not None:
          statinfo = os.stat(filepath)
          if statinfo.st_size != expected_bytes:
              os.remove(filepath)
              raise IOError("Failed to verify {}".format(filepath))
  
      return filepath
  
file_path: interpret-text/notebooks/test_utils/utils_data_shared.py
imports: import os
  import requests
  from tqdm import tqdm
  import math
  import logging
  import zipfile
label_desc: Use image node_id 1 for calling a global function with example usage: maybe_download(url, filename, work_directory, expected_bytes) and returns: filepath