code: def cluster_resources() -> Dict[str, float]:
      """Fetch Ray cluster resources with cache."""
      global cached_cluster_resources
      global cluster_resources_last_fetch_time
      now = time.time()
      if (
          now - cluster_resources_last_fetch_time
          > CLUSTER_RESOURCES_FETCH_INTERVAL_SECONDS
      ):
          cached_cluster_resources = ray.cluster_resources()
          cluster_resources_last_fetch_time = now
      return cached_cluster_resources
  
imports: import importlib
  import logging
  import os
  import pathlib
  import random
  import sys
  import threading
  import time
  import urllib.parse
  from collections import deque
  from types import ModuleType
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, TypeVar, Union
  import numpy
  import ray
  from ray._private.utils import _get_pyarrow_version
  from ray.data._internal.arrow_ops.transform_pyarrow import unify_schemas
  from ray.data.context import WARN_PREFIX, DataContext
label_desc: Use image node_id 1 for calling a global function with example usage: cluster_resources() and returns: cached_cluster_resources