code: def test_extend_prioritized():
      nvals = 16
      states = [np.random.rand(2, 2) for _ in range(nvals)]
      actions = [np.random.rand(2) for _ in range(nvals)]
      rewards = [np.random.rand() for _ in range(nvals)]
      newstate = [np.random.rand(2, 2) for _ in range(nvals)]
      done = [np.random.randint(0, 2) for _ in range(nvals)]
  
      size = 32
      alpha = 0.99
      baseline = PrioritizedReplayBuffer(size, alpha)
      ext = PrioritizedReplayBuffer(size, alpha)
      for data in zip(states, actions, rewards, newstate, done):
          baseline.add(*data)
  
      states, actions, rewards, newstates, done = map(
          np.array, [states, actions, rewards, newstate, done]
      )
  
      ext.extend(states, actions, rewards, newstates, done)
      assert len(baseline) == len(ext)
  
      # Check buffers have same values
      for i in range(nvals):
          for j in range(5):
              condition = baseline.storage[i][j] == ext.storage[i][j]
              if isinstance(condition, np.ndarray):
                  # for obs, obs_t1
                  assert np.all(condition)
              else:
                  # for done, reward action
                  assert condition
  
      # assert priorities
      assert (baseline._it_min._value == ext._it_min._value).all()
      assert (baseline._it_sum._value == ext._it_sum._value).all()
  
imports: import numpy
  from stable_baselines.common.buffers import ReplayBuffer, PrioritizedReplayBuffer
label_desc: Use image node_id 2 for calling a global function with example usage: test_extend_prioritized() without return types