code: def collect_list_of_available_assets(
      catalogue_path="hdri_haven_catalogue.json",
  ):
      catalogue_path = file_io.as_path(catalogue_path)
      if catalogue_path.exists():
          return file_io.read_json(catalogue_path)
  
      # Get a list of available assets
      response = requests.get(
          "https://api.polyhaven.com/assets?t=hdris"
      )
      catalogue = [
          {
              "id": k,
              "asset_type": "Texture",
              "license": "CC0 1.0",
              "url": "https://dl.polyhaven.org/file/ph-assets/HDRIs/hdr/4k/{name}_4k.hdr".format(
                  name=urllib.request.quote(k)
              ),
              "kwargs": {},
              "metadata": {
                  "authors": list(v["authors"].keys()),
                  "resolution": "4k",
                  "coords": v.get("coords"),
                  "date_taken": v["date_taken"],
                  "tags": v["tags"],
                  "categories": v["categories"],
              },
          }
          for k, v in response.json().items()
      ]
      file_io.write_json(catalogue, catalogue_path)
      return catalogue
  
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 1 for calling a global function with example usage: collect_list_of_available_assets(catalogue_path) and returns: catalogue, file_io