class_docstr: Manages cached values for a single st.cache_resource function.
code: def __init__(
      self,
      key: str,
      max_entries: float,
      ttl_seconds: float,
      validate: ValidateFunc | None,
      display_name: str,
      allow_widgets: bool,
  ):
      super().__init__()
      self.key = key
      self.display_name = display_name
      self._mem_cache: TTLCache[str, MultiCacheResults] = TTLCache(
          maxsize=max_entries,
          ttl=ttl_seconds,
          timer=cache_utils.TTLCACHE_TIMER,
      )
      self._mem_cache_lock = threading.Lock()
      self.validate = validate
      self.allow_widgets = allow_widgets
  
imports: from __future__ import annotations
  import math
  import threading
  import types
  from datetime import timedelta
  from typing import Any, Callable, TypeVar, cast, overload
  from cachetools import TTLCache
  from typing_extensions import TypeAlias
  import streamlit
  from streamlit.deprecation_util import show_deprecation_warning
  from streamlit.logger import get_logger
  from streamlit.runtime.caching import cache_utils
  from streamlit.runtime.caching.cache_errors import CacheKeyNotFoundError
  from streamlit.runtime.caching.cache_type import CacheType
  from streamlit.runtime.caching.cache_utils import Cache, CachedFuncInfo, make_cached_func_wrapper, ttl_to_seconds
  from streamlit.runtime.caching.cached_message_replay import CachedMessageReplayContext, CachedResult, ElementMsgData, MsgData, MultiCacheResults
  from streamlit.runtime.caching.hashing import HashFuncsDict
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.runtime.scriptrunner.script_run_context import get_script_run_ctx
  from streamlit.runtime.stats import CacheStat, CacheStatsProvider, group_stats
  from streamlit.vendor.pympler.asizeof import asizeof
label_desc: Use image node_id 1 to create a new ResourceCache object from inherited base classes: Cache with example: obj = ResourceCache(key, max_entries, ttl_seconds, validate, display_name, allow_widgets)