class_docstr: A random shuffling buffer implementation. Items can be added to the buffer and retrieved in a random order.
code: def retrieve(self):
      if not self._done_adding and not self.can_retrieve():
          raise RuntimeError(
              'Can not dequeue. Check the return value of "can_dequeue()" to check if any '
              "items are available."
          )
      batch_size = min(self.batch_size, self._size)
  
      if self._random_indices is None:
          # We randomize the order of all samples ahead of time and then slice it into chunks with ```batch_size```
          self.next_sample_head = 0
          self._random_indices = torch.randperm(
              int(self._size), device=self._items[0].device
          )
      idx = self._random_indices[
          self.next_sample_head : self.next_sample_head + batch_size
      ]
      self.next_sample_head += batch_size
      sample = [v[idx] for v in self._items]
      self._size -= batch_size
      return sample
  
imports: import abc
  import six
  import torch
label_desc: Use image node_id 3 for calling the BatchedRandomShufflingBuffer obj's underlying member method code with example usage: obj.retrieve() and returns: sample