code: def _download(url, filename, path):
      def _progress(count, block_size, total_size):
          percent = (
              float(count * block_size) / float(total_size) * 100.0
          )
          # pylint: disable=cell-var-from-loop
          sys.stdout.write(
              "\r>> Downloading %s %.1f%%" % (filename, percent)
          )
          sys.stdout.flush()
  
      filepath = os.path.join(path, filename)
      filepath, _ = urllib.request.urlretrieve(url, filepath, _progress)
      print()
      statinfo = os.stat(filepath)
      print(
          "Successfully downloaded {} {} bytes.".format(
              filename, statinfo.st_size
          )
      )
  
      return filepath
  
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 2 for calling a global function with example usage: _download(url, filename, path) and returns: filepath