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: Compute where the next path should be stored.
  
  Args:
      n_indices (int): Path length.
  
  Returns:
      tuple: Lists of indices where path should be stored.
  
  Raises:
      ValueError: If path length is greater than the size of buffer.
docstr_tok: ["Compute","where","the","next","path","should","be","stored",".","Args",":","n_indices","(","int",")",":","Path","length",".","Returns",":","tuple",":","Lists","of","indices","where","path","should","be","stored",".","Raises",":","ValueError",":","If","path","length","is","greater","than","the","size","of","buffer","."]
code: def _next_path_segments(self, n_indices):
      """Compute where the next path should be stored.
  
      Args:
          n_indices (int): Path length.
  
      Returns:
          tuple: Lists of indices where path should be stored.
  
      Raises:
          ValueError: If path length is greater than the size of buffer.
  
      """
      if n_indices > self._capacity:
          raise ValueError("Path is too long to store in buffer.")
      start = self._first_idx_of_next_path
      end = start + n_indices
      if end > self._capacity:
          second_end = end - self._capacity
          return (range(start, self._capacity), range(0, second_end))
      else:
          return (range(start, end), range(0, 0))
  
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 7 for calling the PathBuffer obj's underlying member method code with example usage: obj._next_path_segments(n_indices) and returns: range,  range, range,  range