def __iter__(self) -> Iterator[int]:
        """
        Returns:
            indeces for sampling dataset elems during an epoch
        """
        indices = []
        for _ in range(self._num_batches):
            batch_indices = []
            classes_for_batch = random.sample(self._labels, self._num_classes)
            while self._num_classes != len(set(classes_for_batch)):
                classes_for_batch = random.sample(self._labels, self._num_classes)
            for cls_id in classes_for_batch:
                replace_flag = self._num_samples > len(self.lbl2idx[cls_id])
                batch_indices += np.random.choice(
                    self.lbl2idx[cls_id], self._num_samples, replace=replace_flag
                ).tolist()
            indices.append(batch_indices)
        return iter(indices)

        Returns:
            indeces for sampling dataset elems during an epoch
        
catalyst/data/sampler.py