code: def cached_download(url):
      """Downloads a file and caches it.
  
      It downloads a file from the URL if there is no corresponding cache.
      If there is already a cache for the given URL, it just returns the
      path to the cache without downloading the same file.
      This function forked from Chainer, an MIT-licensed project,
      https://github.com/chainer/chainer/blob/v7.4.0/chainer/dataset/download.py#L70
      Args:
          url (string): URL to download from.
      Returns:
          string: Path to the downloaded file.
      """
      cache_root = os.path.join(_models_root, "_dl_cache")
      try:
          os.makedirs(cache_root)
      except OSError:
          if not os.path.exists(cache_root):
              raise
      lock_path = os.path.join(cache_root, "_dl_lock")
      urlhash = hashlib.md5(url.encode("utf-8")).hexdigest()
      cache_path = os.path.join(cache_root, urlhash)
  
      with filelock.FileLock(lock_path):
          if os.path.exists(cache_path):
              return cache_path
      temp_root = tempfile.mkdtemp(dir=cache_root)
      try:
          temp_path = os.path.join(temp_root, "dl")
          print("Downloading ...")
          print("From: {:s}".format(url))
          print("To: {:s}".format(cache_path))
          urllib.request.urlretrieve(url, temp_path, _reporthook)
          with filelock.FileLock(lock_path):
              shutil.move(temp_path, cache_path)
      finally:
          shutil.rmtree(temp_root)
  
      return cache_path
  
file_path: pfrl/pfrl/utils/pretrained_models.py
imports: import hashlib
  import os
  import posixpath
  import shutil
  import sys
  import tempfile
  import time
  import urllib
  import zipfile
  import filelock
label_desc: Use image node_id 3 for calling a global function with example usage: cached_download(url) and returns: cache_path, cache_path