code: def __iter_from_chunks_distributed__(
      self,
  ) -> Iterator[List[Union[int, ChunkedIndex]]]:
      chunk_intervals = self._cache.get_chunk_intervals()
      shuffled_indexes = np.random.permutation(
          range(len(chunk_intervals))
      )
      shuffled_chunk_intervals = np.asarray(chunk_intervals)[
          shuffled_indexes
      ]
  
      replica_chunks = []
      replica_intervals = []
      for index, (chunk_index, chunk_interval) in enumerate(
          zip(shuffled_indexes, shuffled_chunk_intervals)
      ):
          if index % self._num_replicas == self._global_rank:
              replica_chunks.append(chunk_index)
              replica_intervals.append(chunk_interval)
  
      yield from self.__iter_from_shuffled_chunks(
          replica_chunks, replica_intervals
      )
  
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 7 for calling the CacheBatchSampler obj's underlying member method code with example usage: obj.__iter_from_chunks_distributed__() without return types