def retrieve(self):
        """Selects an batch of items from the buffer and returns the batch to the caller.
        The items are removed from the buffer.

        :return: The selected batch.
        """
Selects an batch of items from the buffer and returns the batch to the caller.
        The items are removed from the buffer.

        :return: The selected batch.
        
petastorm/reader_impl/pytorch_shuffling_buffer.py