code: def __iter__(self) -> Iterator[List[Union[int, ChunkedIndex]]]:
      # When the cache is filled, we need to iterate though the chunks
      if self._cache.filled:
          if self._num_replicas == 1:
              return self.__iter_from_chunks_non_distributed__()
          return self.__iter_from_chunks_distributed__()
  
      # shuffle is ignored while building the binarized version of the dataset
      if self._num_replicas == 1:
          return self.__iter_non_distributed__()
      return self.__iter_distributed__()
  
file_path: pytorch-lightning/src/lightning/data/streaming/sampler.py
imports: import logging
  from dataclasses import dataclass
  from typing import Any, Dict, Iterator, List, Optional, Union
  import numpy
label_desc: Use image node_id 3 for calling the CacheBatchSampler obj's underlying member method code with example usage: obj.__iter__() and returns: self, self, self, self