code: def stop_current_episode(self, env_id=0):
      current_episode = self.current_episode[env_id]
      if current_episode:
          self.episodic_memory.append(current_episode)
          for transition in current_episode:
              self.memory.append([transition])
          self.current_episode[env_id] = []
          while (
              self.capacity is not None
              and len(self.memory) > self.capacity
          ):
              discarded_episode = self.episodic_memory.popleft()
              for _ in range(len(discarded_episode)):
                  self.memory.popleft()
      assert not self.current_episode[env_id]
  
file_path: pfrl/pfrl/replay_buffers/episodic.py
imports: import collections
  import pickle
  from typing import Optional
  from pfrl.collections.random_access_queue import RandomAccessQueue
  from pfrl.replay_buffer import AbstractEpisodicReplayBuffer, random_subseq
label_desc: Use image node_id 9 for calling the EpisodicReplayBuffer obj's underlying member method code with example usage: obj.stop_current_episode(env_id) without return types