class_docstr: Cache storage that persists data to disk
  This is the default cache persistence layer for `@st.cache_data`
class_docstr_tok: ["Cache","storage","that","persists","data","to","disk","This","is","the","default","cache","persistence","layer","for","`","@","st.cache_data","`"]
docstr: Sets the value for a given key
docstr_tok: ["Sets","the","value","for","a","given","key"]
code: def set(self, key: str, value: bytes) -> None:
      """Sets the value for a given key"""
      if self.persist == "disk":
          path = self._get_cache_file_path(key)
          try:
              with streamlit_write(path, binary=True) as output:
                  output.write(value)
          except util.Error as e:
              _LOGGER.debug(e)
              # Clean up file so we don't leave zero byte files.
              try:
                  os.remove(path)
              except (FileNotFoundError, IOError, OSError):
                  # If we can't remove the file, it's not a big deal.
                  pass
              raise CacheStorageError("Unable to write to cache") from e
  
imports: from __future__ import annotations
  import math
  import os
  import shutil
  from streamlit import util
  from streamlit.file_util import get_streamlit_file_path, streamlit_read, streamlit_write
  from streamlit.logger import get_logger
  from streamlit.runtime.caching.storage.cache_storage_protocol import CacheStorage, CacheStorageContext, CacheStorageError, CacheStorageKeyNotFoundError, CacheStorageManager
  from streamlit.runtime.caching.storage.in_memory_cache_storage_wrapper import InMemoryCacheStorageWrapper
label_desc: Use image node_id 5 for calling the LocalDiskCacheStorage obj's underlying member method code with example usage: obj.set(key, value) without return types