class_docstr: FIFO queue with fast indexing
  
  Operations getitem, setitem, append, popleft, and len
  are amortized O(1)-time, if this data structure is used ephemerally.
code: def __init__(self, *args, **kwargs):
      self.maxlen = kwargs.pop("maxlen", None)
      assert self.maxlen is None or self.maxlen >= 0
      self._queue_front = []
      self._queue_back = list(*args, **kwargs)
      self._apply_maxlen()
  
file_path: pfrl/pfrl/collections/random_access_queue.py
imports: import itertools
  from pfrl.utils.random import sample_n_k
label_desc: Use image node_id 1 to create a new RandomAccessQueue object from inherited base classes: object with example: obj = RandomAccessQueue()