docstr: The `CacheDataset` is a dataset wraper to provide a beginner experience with the Cache.
  
  Arguments:
      dataset: The dataset of the user
      cache_dir: The folder where the chunks are written to.
      chunk_bytes: The maximal number of bytes to write within a chunk.
      chunk_sie: The maximal number of items to write to a chunk.
      compression: The compression algorithm to use to reduce the size of the chunk.
docstr_tok: ["The","`","CacheDataset","`","is","a","dataset","wraper","to","provide","a","beginner","experience","with","the","Cache",".","Arguments",":","dataset",":","The","dataset","of","the","user","cache_dir",":","The","folder","where","the","chunks","are","written","to",".","chunk_bytes",":","The","maximal","number","of","bytes","to","write","within","a","chunk",".","chunk_sie",":","The","maximal","number","of","items","to","write","to","a","chunk",".","compression",":","The","compression","algorithm","to","use","to","reduce","the","size","of","the","chunk","."]
code: def __init__(
      self,
      dataset: Any,
      cache_dir: str,
      chunk_bytes: Optional[int],
      chunk_size: Optional[int],
      compression: Optional[str],
  ):
      """The `CacheDataset` is a dataset wraper to provide a beginner experience with the Cache.
  
      Arguments:
          dataset: The dataset of the user
          cache_dir: The folder where the chunks are written to.
          chunk_bytes: The maximal number of bytes to write within a chunk.
          chunk_sie: The maximal number of items to write to a chunk.
          compression: The compression algorithm to use to reduce the size of the chunk.
  
      """
      self._dataset = dataset
      self._cache = Cache(
          cache_dir,
          chunk_bytes=chunk_bytes,
          chunk_size=chunk_size,
          compression=compression,
      )
      self._is_deterministic = False
  
imports: import asyncio
  import inspect
  import logging
  import os
  from importlib import reload
  from typing import Any, Callable, Dict, List, Optional, Union
  import torch
  from torch.utils.data import Dataset, IterableDataset
  from torch.utils.data._utils.collate import default_collate
  from torch.utils.data._utils.fetch import _BaseDatasetFetcher
  from torch.utils.data.dataloader import DataLoader, _BaseDataLoaderIter, _DatasetKind, _MultiProcessingDataLoaderIter, _SingleProcessDataLoaderIter
  from torch.utils.data.sampler import BatchSampler, Sampler
  from lightning.data.streaming import Cache
  from lightning.data.streaming.combined import CombinedStreamingDataset
  from lightning.data.streaming.constants import _DEFAULT_CHUNK_BYTES, _TORCH_GREATER_EQUAL_2_1_0, _VIZ_TRACKER_AVAILABLE
  from lightning.data.streaming.dataset import StreamingDataset
  from lightning.data.streaming.sampler import CacheBatchSampler
  from lightning.data.utilities.env import _DistributedEnv
label_desc: Use image node_id 1 to create a new CacheDataset object from inherited base classes: Dataset with example: obj = CacheDataset(dataset, cache_dir, chunk_bytes, chunk_size, compression)