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 _apply_maxlen(self):
      if self.maxlen is not None:
          while len(self) > self.maxlen:
              self.popleft()
  
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 2 for calling the RandomAccessQueue obj's underlying member method code with example usage: obj._apply_maxlen() without return types