code: def download_file_and_uncompress(
      url,
      savepath=None,
      extrapath=None,
      extraname=None,
      print_progress=True,
      cover=True,
      delete_file=True,
  ):
      if savepath is None:
          savepath = "."
  
      if extrapath is None:
          extrapath = "."
  
      savename = url.split("/")[-1]
      if not os.path.exists(savepath):
          os.makedirs(savepath)
  
      savepath = os.path.join(savepath, savename)
      savename = ".".join(savename.split(".")[:-1])
      savename = os.path.join(extrapath, savename)
      extraname = (
          savename
          if extraname is None
          else os.path.join(extrapath, extraname)
      )
  
      if cover:
          if os.path.exists(savepath):
              shutil.rmtree(savepath)
          if os.path.exists(savename):
              shutil.rmtree(savename)
          if os.path.exists(extraname):
              shutil.rmtree(extraname)
  
      if not os.path.exists(extraname):
          if not os.path.exists(savename):
              if not os.path.exists(savepath):
                  _download_file(url, savepath, print_progress)
  
              if (not tarfile.is_tarfile(savepath)) and (
                  not zipfile.is_zipfile(savepath)
              ):
                  if not os.path.exists(extraname):
                      os.makedirs(extraname)
                  shutil.move(savepath, extraname)
                  return extraname
  
              savename = _uncompress_file(
                  savepath, extrapath, delete_file, print_progress
              )
              savename = os.path.join(extrapath, savename)
          shutil.move(savename, extraname)
      return extraname
  
file_path: PaddleSeg/contrib/MedicalSeg/medicalseg/utils/download.py
imports: import functools
  import os
  import shutil
  import sys
  import tarfile
  import time
  import zipfile
  import requests
label_desc: Use image node_id 6 for calling a global function with example usage: download_file_and_uncompress(url, savepath, extrapath, extraname, print_progress, cover, delete_file) and returns: extraname, extraname