code: def test_recsim_interest_exploration(self) -> None:
      num_candidate = 10
      # pyre-fixme[16]: Module `envs` has no attribute `RecSim`.
      env = RecSim(
          num_candidates=num_candidate,
          slate_size=3,
          resample_documents=False,
          is_interest_exploration=True,
      )
      obs_preprocessor = env.get_obs_preprocessor()
      obs = env.reset()
      state = obs_preprocessor(obs)
      self.assertFalse(state.has_float_features_only)
      self.assertEqual(
          state.float_features.shape, (1, obs["user"].shape[0])
      )
      self.assertEqual(state.float_features.dtype, torch.float32)
      self.assertEqual(state.float_features.device, torch.device("cpu"))
      npt.assert_array_almost_equal(
          obs["user"], state.float_features.squeeze(0)
      )
      doc_float_features = state.candidate_docs.float_features
      self.assertIsNotNone(doc_float_features)
  
      quality_len = 1
      expected_doc_feature_length = (
          env.observation_space["doc"]["0"]["cluster_id"].n
          + quality_len
      )
  
      self.assertEqual(
          doc_float_features.shape,
          (1, num_candidate, expected_doc_feature_length),
      )
      self.assertEqual(doc_float_features.dtype, torch.float32)
      self.assertEqual(doc_float_features.device, torch.device("cpu"))
      for i, v in enumerate(obs["doc"].values()):
          expected_doc_feature = torch.cat(
              [
                  F.one_hot(torch.tensor(v["cluster_id"]), 2).float(),
                  # This needs unsqueeze because it's a scalar
                  torch.tensor(v["quality"]).unsqueeze(0).float(),
              ],
              dim=0,
          )
          npt.assert_array_almost_equal(
              expected_doc_feature, doc_float_features[0, i]
          )
  
file_path: ReAgent/reagent/gym/tests/preprocessors/test_default_preprocessors.py
imports: import unittest
  import numpy.testing
  import torch
  import torch.nn.functional
  from reagent.gym.envs import Gym
label_desc: Use image node_id 4 for calling the TestMakeDefaultObsPreprocessor obj's underlying member method code with example usage: obj.test_recsim_interest_exploration() without return types