code: def stop_current_episode(self, env_id=0):
      current_episode = self.current_episode[env_id]
      if current_episode:
          if self.default_priority_func is not None:
              priority = self.default_priority_func(current_episode)
          else:
              priority = None
          self.memory.extend(current_episode)
          self.episodic_memory.append(
              current_episode, priority=priority
          )
          if self.capacity_left is not None:
              self.capacity_left -= len(current_episode)
          self.current_episode[env_id] = []
          while (
              self.capacity_left is not None and self.capacity_left < 0
          ):
              discarded_episode = self.episodic_memory.popleft()
              self.capacity_left += len(discarded_episode)
      assert not self.current_episode[env_id]
  
file_path: pfrl/pfrl/replay_buffers/prioritized_episodic.py
imports: import collections
  from pfrl.collections.prioritized import PrioritizedBuffer
  from pfrl.collections.random_access_queue import RandomAccessQueue
  from pfrl.replay_buffer import random_subseq
  from pfrl.replay_buffers import EpisodicReplayBuffer, PriorityWeightError
label_desc: Use image node_id 4 for calling the PrioritizedEpisodicReplayBuffer obj's underlying member method code with example usage: obj.stop_current_episode(env_id) without return types