code: def test_transform_observation_features_HSS(self) -> None:
      # Untransform the observation features first to cast them and
      # save their full parameterization in metadata.
      obs_feats = self.t_hss.untransform_observation_features(
          observation_features=[self.obs_feats_hss]
      )
      with patch.object(
          self.t_hss.search_space,
          "flatten_observation_features",
          wraps=self.t_hss.search_space.flatten_observation_features,  # pyre-ignore
      ) as mock_flatten_obsf:
          transformed_obs_feats = (
              self.t_hss.transform_observation_features(
                  observation_features=obs_feats
              )
          )
          mock_flatten_obsf.assert_called_once()
  
      for obsf in transformed_obs_feats:
          # Check that transformed obs feats have all the parameters
          for p_name in self.t_hss.search_space.parameters:
              self.assertIn(p_name, obsf.parameters)
          # Check that full parameterization is recorded in metadata
          self.assertEqual(
              # pyre-fixme[16]: Optional type has no attribute `get`.
              obsf.metadata.get(Keys.FULL_PARAMETERIZATION),
              self.obs_feats_hss.parameters,
          )
  
      # Perform one more roundtrip so parameterizations are cast to HSS.
      obs_feats = self.t_hss.untransform_observation_features(
          observation_features=transformed_obs_feats
      )
      new_transformed_obs_feats = (
          self.t_hss.transform_observation_features(
              observation_features=obs_feats
          )
      )
      for obsf in new_transformed_obs_feats:
          # Check that transformed obs feats have all the parameters
          for p_name in self.t_hss.search_space.parameters:
              self.assertIn(p_name, obsf.parameters)
          # Check that full parameterization is recorded in metadata
          self.assertEqual(
              obsf.metadata.get(Keys.FULL_PARAMETERIZATION),
              self.obs_feats_hss.parameters,
          )
  
file_path: Ax/ax/modelbridge/transforms/tests/test_cast_transform.py
imports: from copy import deepcopy
  from unittest.mock import patch
  from ax.core.observation import ObservationFeatures
  from ax.core.parameter import ChoiceParameter, FixedParameter, ParameterType, RangeParameter
  from ax.core.search_space import HierarchicalSearchSpace, SearchSpace
  from ax.modelbridge.transforms.cast import Cast
  from ax.utils.common.constants import Keys
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_hierarchical_search_space
label_desc: Use image node_id 6 for calling the CastTransformTest obj's underlying member method code with example usage: obj.test_transform_observation_features_HSS() without return types