code: def maybe_download(urls, path, filenames=None, extract=False):
      """Downloads a set of files.
  
      Args:
          urls: A (list of) urls to download files.
          path (str): The destination path to save the files.
          filenames: A (list of) strings of the file names. If given,
              must have the same length with :attr:`urls`. If `None`,
              filenames are extracted from :attr:`urls`.
          extract (bool): Whether to extract compressed files.
  
      Returns:
          A list of paths to the downloaded files.
      """
      utils_io.maybe_create_dir(path)
  
      if not isinstance(urls, (list, tuple)):
          urls = [urls]
      if filenames is not None:
          if not isinstance(filenames, (list, tuple)):
              filenames = [filenames]
          if len(urls) != len(filenames):
              raise ValueError(
                  "`filenames` must have the same number of elements as `urls`."
              )
  
      result = []
      for i, url in enumerate(urls):
          if filenames is not None:
              filename = filenames[i]
          elif "drive.google.com" in url:
              filename = _extract_google_drive_file_id(url)
          else:
              filename = url.split("/")[-1]
              # If downloading from GitHub, remove suffix ?raw=True
              # from local filename
              if filename.endswith("?raw=true"):
                  filename = filename[:-9]
  
          filepath = os.path.join(path, filename)
          result.append(filepath)
  
          if not tf.gfile.Exists(filepath):
              if "drive.google.com" in url:
                  filepath = _download_from_google_drive(
                      url, filename, path
                  )
              else:
                  filepath = _download(url, filename, path)
  
              if extract:
                  tf.logging.info("Extract %s", filepath)
                  if tarfile.is_tarfile(filepath):
                      tarfile.open(filepath, "r").extractall(path)
                  elif zipfile.is_zipfile(filepath):
                      with zipfile.ZipFile(filepath) as zfile:
                          zfile.extractall(path)
                  else:
                      tf.logging.info(
                          "Unknown compression type. Only .tar.gz, "
                          ".tar.bz2, .tar, and .zip are supported"
                      )
  
      return result
  
file_path: texar/texar/tf/data/data_utils.py
imports: import os
  import sys
  import tarfile
  import zipfile
  import collections
  import numpy
  from six.moves import urllib
  import requests
  import tensorflow
  from texar.tf.utils import utils_io
label_desc: Use image node_id 1 for calling a global function with example usage: maybe_download(urls, path, filenames, extract) and returns: result