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.
class_docstr_tok: ["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: chainerrl/chainerrl/misc/collections.py
imports: import itertools
  from chainerrl.misc.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()