code: def download_data_url(url, download_dir):
      filename = url.split("/")[-1]
      file_path = os.path.join(download_dir, filename)
  
      if not os.path.exists(file_path):
          os.makedirs(download_dir, exist_ok=True)
  
          print("Download %s to %s" % (url, file_path))
          file_path, _ = urllib.request.urlretrieve(
              url=url,
              filename=file_path,
              reporthook=report_download_progress,
          )
  
          print("\nExtracting files")
          if file_path.endswith(".zip"):
              zipfile.ZipFile(file=file_path, mode="r").extractall(
                  download_dir
              )
          elif file_path.endswith((".tar.gz", ".tgz")):
              tarfile.open(name=file_path, mode="r:gz").extractall(
                  download_dir
              )
  
imports: import sys
  import os
  import urllib.request
  import tarfile
  import zipfile
label_desc: Use image node_id 2 for calling a global function with example usage: download_data_url(url, download_dir) without return types