code: def test_clean(buffer: SingleEpisodeBuffer):
      # add several transitions and then clean the buffer
      transition = Transition(
          state={"observation": np.array([1, 2, 3])},
          action=1,
          reward=1,
          game_over=False,
      )
      for i in range(10):
          buffer.store(transition)
      assert buffer.num_transitions() == 10
      buffer.clean()
      assert buffer.num_transitions() == 0
  
      # add more transitions after the clean and make sure they were really cleaned
      transition = Transition(
          state={"observation": np.array([1, 2, 3])},
          action=1,
          reward=1,
          game_over=True,
      )
      buffer.store(transition)
      assert buffer.num_transitions() == 1
      assert buffer.num_transitions_in_complete_episodes() == 1
      assert buffer.num_complete_episodes() == 1
      for i in range(10):
          assert buffer.sample(1)[0] is transition
  
file_path: coach/rl_coach/tests/memories/test_single_episode_buffer.py
imports: import os
  import sys
  import pytest
  import numpy
  from rl_coach.core_types import Transition
  from rl_coach.memories.episodic.single_episode_buffer import SingleEpisodeBuffer
label_desc: Use image node_id 3 for calling a global function with example usage: test_clean(buffer) without return types