code: def download_image(image_id, url, x1, y1, x2, y2, output_dir):
      """Downloads one image, crops it, resizes it and saves it locally."""
      output_filename = os.path.join(output_dir, image_id + ".png")
      if os.path.exists(output_filename):
          # Don't download image if it's already there
          return True
      try:
          # Download image
          url_file = urlopen(url)
          if url_file.getcode() != 200:
              return False
          image_buffer = url_file.read()
          # Crop, resize and save image
          image = Image.open(BytesIO(image_buffer)).convert("RGB")
          w = image.size[0]
          h = image.size[1]
          image = image.crop(
              (int(x1 * w), int(y1 * h), int(x2 * w), int(y2 * h))
          )
          image = image.resize((299, 299), resample=Image.ANTIALIAS)
          image.save(output_filename)
      except IOError:
          return False
      return True
  
file_path: cleverhans/cleverhans_v3.1.0/examples/nips17_adversarial_competition/dataset/download_images.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import csv
  import os
  import sys
  from functools import partial
  from io import BytesIO
  import multiprocessing
  from multiprocessing.dummy import Pool
  from PIL import Image
label_desc: Use image node_id 3 for calling a global function with example usage: download_image(image_id, url, x1, y1, x2, y2, output_dir) and returns: True, True, False, False