docstr: Implements a ring buffer (FIFO).
  
  :param size: (int)  Max number of transitions to store in the buffer. When the buffer overflows the old
      memories are dropped.
docstr_tok: ["Implements","a","ring","buffer","(","FIFO",")",".",":","param","size",":","(","int",")","Max","number","of","transitions","to","store","in","the","buffer",".","When","the","buffer","overflows","the","old","memories","are","dropped","."]
code: def __init__(self, size: int):
      """
      Implements a ring buffer (FIFO).
  
      :param size: (int)  Max number of transitions to store in the buffer. When the buffer overflows the old
          memories are dropped.
      """
      self._storage = []
      self._maxsize = size
      self._next_idx = 0
  
imports: import random
  from typing import Optional, List, Union
  import numpy
  from stable_baselines.common.segment_tree import SumSegmentTree, MinSegmentTree
  from stable_baselines.common.vec_env import VecNormalize
label_desc: Use image node_id 1 to create a new ReplayBuffer object from inherited base classes: object with example: obj = ReplayBuffer(size)