class_docstr: A minimal replay buffer used by Decision Transformer (DT)
  to process episodes into max_seq_len length segments and do shuffling.
class_docstr_tok: ["A","minimal","replay","buffer","used","by","Decision","Transformer","(","DT",")","to","process","episodes","into","max_seq_len","length","segments","and","do","shuffling","."]
docstr: Args:
      capacity: Maximum number of episodes the buffer can store.
      max_seq_len: Length of segments that are sampled.
      max_ep_len: Maximum length of episodes added.
docstr_tok: ["Args",":","capacity",":","Maximum","number","of","episodes","the","buffer","can","store",".","max_seq_len",":","Length","of","segments","that","are","sampled",".","max_ep_len",":","Maximum","length","of","episodes","added","."]
code: def __init__(
      self,
      capacity: int = 20,
      max_seq_len: int = 20,
      max_ep_len: int = 1000,
  ):
      """
      Args:
          capacity: Maximum number of episodes the buffer can store.
          max_seq_len: Length of segments that are sampled.
          max_ep_len: Maximum length of episodes added.
      """
      self.capacity = capacity
      self.max_seq_len = max_seq_len
      self.max_ep_len = max_ep_len
  
      self._buffer: List[SampleBatch] = []
  
file_path: ray/rllib_contrib/dt/src/rllib_dt/dt/segmentation_buffer.py
imports: import logging
  import random
  from collections import defaultdict
  from typing import List
  import numpy
  from ray.rllib.evaluation.postprocessing import discount_cumsum
  from ray.rllib.policy.sample_batch import MultiAgentBatch, SampleBatch, concat_samples
  from ray.rllib.utils.typing import SampleBatchType
label_desc: Use image node_id 1 to create a new SegmentationBuffer object  with example: obj = SegmentationBuffer(capacity, max_seq_len, max_ep_len)