code: def download_asset(a, download_dir):
      filename = pathlib.Path(urllib.parse.urlparse(a["url"]).path).name
      download_dir = pathlib.Path(download_dir)
      target_path = download_dir / filename
      if not target_path.exists():
          try:
              opener = urllib.request.URLopener()
              opener.addheader("User-Agent", "Mozilla/5.0")
              opener.retrieve(a["url"], target_path)
          except (urllib.error.HTTPError, urllib.error.URLError) as e:
              logging.warning(f"FAILED! skipping '{a['name']}'", e)
  
file_path: kubric/kubric/scripts/download_hdri_haven.py
imports: import argparse
  import copy
  import functools
  import logging
  import multiprocessing
  import pathlib
  import shutil
  import tarfile
  import urllib.error
  import urllib.parse
  import urllib.request
  import requests
  import tqdm
  from kubric import file_io
  from kubric.kubric_typing import PathLike
label_desc: Use image node_id 2 for calling a global function with example usage: download_asset(a, download_dir) without return types