code: def test_append_and_sample(self):
      capacity = self.capacity
      rbuf = replay_buffer.EpisodicReplayBuffer(capacity)
  
      for n in [10, 15, 5] * 3:
          transs = [
              dict(
                  state=i,
                  action=100 + i,
                  reward=200 + i,
                  next_state=i + 1,
                  next_action=101 + i,
                  is_state_terminal=(i == n - 1),
              )
              for i in range(n)
          ]
          for trans in transs:
              rbuf.append(**trans)
  
      self.assertEqual(len(rbuf), 90)
      self.assertEqual(rbuf.n_episodes, 9)
  
      for k in [10, 30, 90]:
          s = rbuf.sample(k)
          self.assertEqual(len(s), k)
  
      for k in [1, 3, 9]:
          s = rbuf.sample_episodes(k)
          self.assertEqual(len(s), k)
  
          s = rbuf.sample_episodes(k, max_len=10)
          for ep in s:
              self.assertLessEqual(len(ep), 10)
              for t0, t1 in zip(ep, ep[1:]):
                  self.assertEqual(t0["next_state"], t1["state"])
                  self.assertEqual(t0["next_action"], t1["action"])
  
imports: import collections
  import copy
  import os
  import tempfile
  import unittest
  from chainer import testing
  import numpy
  from chainerrl import replay_buffer
label_desc: Use image node_id 1 for calling the TestEpisodicReplayBuffer obj's underlying member method code with example usage: obj.test_append_and_sample() without return types