class_docstr: Defines a common interface of episodic replay buffer.
  
  Episodic replay buffers allows you to append and sample episodes.
class_docstr_tok: ["Defines","a","common","interface","of","episodic","replay","buffer",".","Episodic","replay","buffers","allows","you","to","append","and","sample","episodes","."]
docstr: Sample n unique (sub)episodes from this replay buffer.
  
  Args:
      n (int): Number of episodes to sample.
      max_len (int or None): Maximum length of sampled episodes. If it is
          smaller than the length of some episode, the subsequence of the
          episode is sampled instead. If None, full episodes are always
          returned.
  Returns:
      Sequence of n sampled episodes, each of which is a sequence of
      transitions.
docstr_tok: ["Sample","n","unique","(","sub",")","episodes","from","this","replay","buffer",".","Args",":","n","(","int",")",":","Number","of","episodes","to","sample",".","max_len","(","int","or","None",")",":","Maximum","length","of","sampled","episodes",".","If","it","is","smaller","than","the","length","of","some","episode",",","the","subsequence","of","the","episode","is","sampled","instead",".","If","None",",","full","episodes","are","always","returned",".","Returns",":","Sequence","of","n","sampled","episodes",",","each","of","which","is","a","sequence","of","transitions","."]
code: def sample_episodes(self, n_episodes, max_len=None):
      """Sample n unique (sub)episodes from this replay buffer.
  
      Args:
          n (int): Number of episodes to sample.
          max_len (int or None): Maximum length of sampled episodes. If it is
              smaller than the length of some episode, the subsequence of the
              episode is sampled instead. If None, full episodes are always
              returned.
      Returns:
          Sequence of n sampled episodes, each of which is a sequence of
          transitions.
      """
      raise NotImplementedError
  
imports: from abc import ABCMeta, abstractmethod, abstractproperty
  from typing import Optional
  import numpy
  import torch
  from pfrl.utils.batch_states import batch_states
  from pfrl.utils.recurrent import concatenate_recurrent_states, flatten_sequences_time_first, recurrent_state_from_numpy
label_desc: Use image node_id 1 for calling the AbstractEpisodicReplayBuffer obj's underlying member method code with example usage: obj.sample_episodes(n_episodes, max_len) without return types