class_docstr: Manages all DataCache instances
class_docstr_tok: ["Manages","all","DataCache","instances"]
docstr: Validate that the cache params are valid for given storage.
  
  Raises
  ------
  InvalidCacheStorageContext
      Raised if the cache storage manager is not able to work with provided
      CacheStorageContext.
docstr_tok: ["Validate","that","the","cache","params","are","valid","for","given","storage",".","Raises","--","--","--","InvalidCacheStorageContext","Raised","if","the","cache","storage","manager","is","not","able","to","work","with","provided","CacheStorageContext","."]
code: def validate_cache_params(
      self,
      function_name: str,
      persist: CachePersistType,
      max_entries: int | None,
      ttl: int | float | timedelta | str | None,
  ) -> None:
      """Validate that the cache params are valid for given storage.
  
      Raises
      ------
      InvalidCacheStorageContext
          Raised if the cache storage manager is not able to work with provided
          CacheStorageContext.
      """
  
      ttl_seconds = ttl_to_seconds(ttl, coerce_none_to_inf=False)
  
      cache_context = self.create_cache_storage_context(
          function_key="DUMMY_KEY",
          function_name=function_name,
          ttl_seconds=ttl_seconds,
          max_entries=max_entries,
          persist=persist,
      )
      try:
          self.get_storage_manager().check_context(cache_context)
      except InvalidCacheStorageContext as e:
          _LOGGER.error(
              "Cache params for function %s are incompatible with current "
              "cache storage manager: %s",
              function_name,
              e,
          )
          raise
  
imports: from __future__ import annotations
  import pickle
  import threading
  import types
  from datetime import timedelta
  from typing import Any, Callable, TypeVar, Union, cast, overload
  from typing_extensions import Literal, TypeAlias
  import streamlit
  from streamlit import runtime
  from streamlit.deprecation_util import show_deprecation_warning
  from streamlit.errors import StreamlitAPIException
  from streamlit.logger import get_logger
  from streamlit.runtime.caching.cache_errors import CacheError, 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.caching.storage import CacheStorage, CacheStorageContext, CacheStorageError, CacheStorageKeyNotFoundError, CacheStorageManager
  from streamlit.runtime.caching.storage.cache_storage_protocol import InvalidCacheStorageContext
  from streamlit.runtime.caching.storage.dummy_cache_storage import MemoryCacheStorageManager
  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
label_desc: Use image node_id 5 for calling the DataCaches obj's underlying member method code with example usage: obj.validate_cache_params(function_name, persist, max_entries, ttl) without return types