code: def __iter__(self):
      self._ssi = self.rank * self.cpb if self.unique_cpb else 0
      self._next_perm()
  
      # -- iterations per epoch (extract batch-size samples from each class)
      ipe = self.ipe * self.batch_size
  
      for epoch in range(self.epochs):
          # -- shuffle class order
          samplers = self._get_local_samplers(epoch)
          subsampled_samplers = self._subsample_samplers(samplers)
  
          counter, batch = 0, []
          for i in range(ipe):
              batch += list(next(subsampled_samplers))
              counter += 1
              if counter == self.batch_size:
                  # for idx in batch:
                  #     yield idx
                  yield batch
                  counter, batch = 0, []
                  if i + 1 < ipe:
                      subsampled_samplers = self._subsample_samplers(
                          samplers
                      )
  
imports: import contextlib
  import logging
  import queue
  from typing import Dict, List
  import numpy
  import torch
  from PIL import Image
  from torch.utils.data import Dataset
  from torch.utils.data.distributed import DistributedSampler
label_desc: Use image node_id 10 for calling the StratifiedClassSampler obj's underlying member method code with example usage: obj.__iter__() without return types