code: def download_or_cache(url, version):
      """
      Get bytes from the given url or local cache.
  
      Parameters
      ----------
      url : str
          The url to download.
      sha : str
          The sha256 of the file.
  
      Returns
      -------
      BytesIO
          The file loaded into memory.
      """
      cache_dir = _get_xdg_cache_dir()
  
      if cache_dir is not None:  # Try to read from cache.
          try:
              data = (cache_dir / version).read_bytes()
          except OSError:
              pass
          else:
              return BytesIO(data)
  
      with urllib.request.urlopen(
          urllib.request.Request(url, headers={"User-Agent": ""})
      ) as req:
          data = req.read()
  
      if cache_dir is not None:  # Try to cache the downloaded file.
          try:
              cache_dir.mkdir(parents=True, exist_ok=True)
              with open(cache_dir / version, "xb") as fout:
                  fout.write(data)
          except OSError:
              pass
  
      return BytesIO(data)
  
imports: import urllib.request
  from io import BytesIO
  import os
  from pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: download_or_cache(url, version) and returns: BytesIO, BytesIO