class_docstr: A replay buffer that stores and can sample whole episodes.
  
  This buffer only stores valid steps, and doesn't require paths to
  have a maximum length.
  
  Args:
      capacity_in_transitions (int): Total memory allocated for the buffer.
      env_spec (EnvSpec): Environment specification.
class_docstr_tok: ["A","replay","buffer","that","stores","and","can","sample","whole","episodes",".","This","buffer","only","stores","valid","steps",",","and","does","n't","require","paths","to","have","a","maximum","length",".","Args",":","capacity_in_transitions","(","int",")",":","Total","memory","allocated","for","the","buffer",".","env_spec","(","EnvSpec",")",":","Environment","specification","."]
docstr: Get or allocate key in the buffer.
  
  Args:
      key (str): Key in buffer.
      array (numpy.ndarray): Array corresponding to key.
  
  Returns:
      numpy.ndarray: A NumPy array corresponding to key in the buffer.
docstr_tok: ["Get","or","allocate","key","in","the","buffer",".","Args",":","key","(","str",")",":","Key","in","buffer",".","array","(","numpy.ndarray",")",":","Array","corresponding","to","key",".","Returns",":","numpy.ndarray",":","A","NumPy","array","corresponding","to","key","in","the","buffer","."]
code: def _get_or_allocate_key(self, key, array):
      """Get or allocate key in the buffer.
  
      Args:
          key (str): Key in buffer.
          array (numpy.ndarray): Array corresponding to key.
  
      Returns:
          numpy.ndarray: A NumPy array corresponding to key in the buffer.
  
      """
      buf_arr = self._buffer.get(key, None)
      if buf_arr is None:
          buf_arr = np.zeros(
              (self._capacity, array.shape[1]), array.dtype
          )
          self._buffer[key] = buf_arr
      return buf_arr
  
file_path: garage/src/garage/replay_buffer/path_buffer.py
imports: import collections
  import numpy
  from garage import StepType, TimeStepBatch
label_desc: Use image node_id 8 for calling the PathBuffer obj's underlying member method code with example usage: obj._get_or_allocate_key(key, array) and returns: buf_arr