code: def cache(url, unzip=False, relative_path=None, cache_dir=None):
      """Download the data and cache to file
  
      Parameters
      ----------
      url: str
          The url to the data.
  
      unzip: bool, optional, default: False
          Whether the data is a zip file and going to be unzipped after the download.
  
      relative_path: str
          Relative path to the data file after finishing the download.
          If unzip=True, relative_path is the path to unzipped file.
  
      cache_dir: str, optional, default: None
          The path to cache folder. If `None`, either ~/.cornac or /tmp/.cornac will be used.
  
      """
      if relative_path is None:
          relative_path = url.split("/")[-1]
      cache_path, cache_dir = get_cache_path(relative_path, cache_dir)
      if os.path.exists(cache_path):
          return cache_path
  
      print("Data from", url)
      print("will be cached into", cache_path)
  
      if unzip:
          tmp_path = os.path.join(cache_dir, "file.tmp")
          _urlretrieve(url, tmp_path)
          print("Unzipping ...")
          _extract_archive(tmp_path, cache_dir)
          os.remove(tmp_path)
      else:
          _urlretrieve(url, cache_path)
  
      print("File cached!")
      return cache_path
  
file_path: cornac/cornac/utils/download.py
imports: import os
  import shutil
  import zipfile
  import tarfile
  from urllib import request
  from tqdm.auto import tqdm
label_desc: Use image node_id 4 for calling a global function with example usage: cache(url, unzip, relative_path, cache_dir) and returns: cache_path, cache_path