def _batch_examples_and_preds(
        self,
        examples: List[Any],
        predictions: List[Any],
        batch_size: int = 10,
        start_position: int = 0,
    ):
        """Batches examples and predictions with a given batch_size."""
        assert self._num_examples == len(predictions)
        for ndx in range(start_position, self._num_examples, batch_size):
            yield (
                examples[ndx : min(ndx + batch_size, self._num_examples)],
                predictions[ndx : min(ndx + batch_size, self._num_examples)],
            )
Batches examples and predictions with a given batch_size.
llama-index-packs/llama-index-packs-rag-evaluator/llama_index/packs/rag_evaluator/base.py