code: def test_recsim_interest_exploration(self):
      num_candidate = 10
      slate_size = 3
      env = RecSim(
          num_candidates=num_candidate,
          slate_size=slate_size,
          resample_documents=False,
          is_interest_exploration=True,
      )
      replay_buffer, inserted = _create_replay_buffer_and_insert(env)
      batch = replay_buffer.sample_transition_batch(
          indices=torch.tensor([0])
      )
      npt.assert_array_almost_equal(
          inserted[0]["observation"]["user"].astype(np.float32),
          batch.state.squeeze(0),
      )
      npt.assert_array_almost_equal(
          inserted[1]["observation"]["user"],
          batch.next_state.squeeze(0),
      )
      docs = list(inserted[0]["observation"]["doc"].values())
      next_docs = list(inserted[1]["observation"]["doc"].values())
      for i in range(num_candidate):
          npt.assert_array_almost_equal(
              docs[i]["quality"], batch.doc_quality.squeeze(0)[i]
          )
          npt.assert_array_almost_equal(
              next_docs[i]["quality"],
              batch.next_doc_quality.squeeze(0)[i],
          )
      npt.assert_array_equal(
          inserted[0]["action"], batch.action.squeeze(0)
      )
      npt.assert_array_equal(
          inserted[1]["action"], batch.next_action.squeeze(0)
      )
      npt.assert_array_equal([0, 0, 0], batch.response_click.squeeze(0))
      npt.assert_array_equal(
          [0, 0, 0], batch.response_cluster_id.squeeze(0)
      )
      npt.assert_array_equal(
          [0.0, 0.0, 0.0], batch.response_quality.squeeze(0)
      )
      resp = inserted[1]["observation"]["response"]
      for i in range(slate_size):
          npt.assert_array_equal(
              resp[i]["click"], batch.next_response_click.squeeze(0)[i]
          )
          npt.assert_array_equal(
              resp[i]["cluster_id"],
              batch.next_response_cluster_id.squeeze(0)[i],
          )
          npt.assert_array_almost_equal(
              resp[i]["quality"].astype(np.float32),
              batch.next_response_quality.squeeze(0)[i],
          )
  
file_path: ReAgent/reagent/gym/tests/preprocessors/test_replay_buffer_inserters.py
imports: import logging
  import unittest
  import gym
  import numpy
  import numpy.testing
  import torch
  from reagent.gym.envs import EnvWrapper
  from reagent.gym.preprocessors import make_replay_buffer_inserter
  from reagent.gym.types import Transition
  from reagent.replay_memory import ReplayBuffer
  from reagent.test.base.horizon_test_base import HorizonTestBase
label_desc: Use image node_id 2 for calling the TestRecSimReplayBufferInserter obj's underlying member method code with example usage: obj.test_recsim_interest_exploration() without return types