code: def download_image(path, url):
      image_name = url.split("/")[-1]
      image_name = image_name.split("?")[0]
      image_prefix = image_name.split(".")[0]
      saving_path = os.path.join(path, image_prefix + ".jpg")
      urllib.request.urlretrieve(url, saving_path)
  
      try:
          # Throw an exception if the image is unreadable or corrupted
          Image.open(saving_path).verify()
  
          # Remove images smaller than 10kb, to make sure we are not downloading empty/low quality images
          if tf.io.gfile.stat(saving_path).length < kMinFileSize:
              tf.io.gfile.remove(saving_path)
      # PIL.Image.verify() throws a default exception if it finds a corrupted image.
      except Exception as e:
          tf.io.gfile.remove(
              saving_path
          )  # We need to delete it, since urllib automatically saves them.
          raise e
  
file_path: tcav/tcav/tcav_examples/image_models/imagenet/imagenet_and_broden_fetcher.py
imports: import pandas
  import urllib.request
  import os
  import shutil
  import PIL
  from PIL import Image
  import tensorflow
  import socket
  import random
label_desc: Use image node_id 2 for calling a global function with example usage: download_image(path, url) without return types