code: def __iter_non_distributed__(
      self,
  ) -> Iterator[List[Union[int, ChunkedIndex]]]:
      worker_size = self._dataset_size // self._num_workers
      indices = list(range(self._dataset_size))
      worker_indices = []
      for worker_idx in range(self._num_workers):
          is_last = worker_idx == self._num_workers - 1
          start = worker_idx * worker_size
          end = (
              self._dataset_size
              if is_last
              else (worker_idx + 1) * worker_size
          )
          worker_indices.append(indices[start:end])
  
      assert sum([len(s) for s in worker_indices]) == self._dataset_size
  
      worker_indices_batches = [
          self._chunk_list(indices, self._batch_size)
          for indices in worker_indices
      ]
  
      yield from self.__iter_indices_per_workers__(
          worker_indices_batches
      )
  
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 4 for calling the CacheBatchSampler obj's underlying member method code with example usage: obj.__iter_non_distributed__() without return types