def __next__(self):
        """Next batch.

        Returns:
            next batch

        Raises:
            StopIteration: if iteration_index >= len(origin)
        """
        if self.iteration_index >= len(self.origin):
            raise StopIteration()
        self.iteration_index += 1
        if self.iteration_index % self.num_batches == 0:
            self._iterator, self.iterator = tee(self._iterator)
        batch = next(self.iterator)
        return batch
Next batch.

        Returns:
            next batch

        Raises:
            StopIteration: if iteration_index >= len(origin)
        
catalyst/data/loader.py