docstr: Initializes replay buffer.
  
  Args:
    capacity: Max capacity of buffer.
docstr_tok: ["Initializes","replay","buffer",".","Args",":","capacity",":","Max","capacity","of","buffer","."]
code: def __init__(self, capacity):
      """Initializes replay buffer.
  
      Args:
        capacity: Max capacity of buffer.
      """
      self.buffer = deque(maxlen=capacity)
  
file_path: FinRL/finrl/agents/portfolio_optimization/utils.py
imports: from __future__ import annotations
  from collections import deque
  import numpy
  from torch.utils.data.dataset import IterableDataset
label_desc: Use image node_id 1 to create a new ReplayBuffer object  with example: obj = ReplayBuffer(capacity)