code: def test_w_parameter_distributions(self) -> None:
      rss = get_robust_search_space()
      # pyre-fixme[16]: `Parameter` has no attribute `_is_ordered`.
      rss.parameters["c"]._is_ordered = True
      # Transform a non-distributional parameter.
      t = self.t_class(
          search_space=rss,
          observations=[],
      )
      rss_new = t.transform_search_space(rss)
      # Make sure that the return value is still a RobustSearchSpace.
      self.assertIsInstance(rss_new, RobustSearchSpace)
      self.assertEqual(
          set(rss.parameters.keys()), set(rss_new.parameters.keys())
      )
      # pyre-fixme[16]: `SearchSpace` has no attribute `parameter_distributions`.
      self.assertEqual(
          rss.parameter_distributions, rss_new.parameter_distributions
      )
      # pyre-fixme[16]: Optional type has no attribute `parameter_type`.
      self.assertEqual(
          rss_new.parameters.get("c").parameter_type, ParameterType.INT
      )
      # Test with environmental variables.
      all_params = list(rss.parameters.values())
      rss = RobustSearchSpace(
          parameters=all_params[2:],
          parameter_distributions=rss.parameter_distributions,
          num_samples=rss.num_samples,
          environmental_variables=all_params[:2],
      )
      t = self.t_class(
          search_space=rss,
          observations=[],
      )
      rss_new = t.transform_search_space(rss)
      self.assertIsInstance(rss_new, RobustSearchSpace)
      self.assertEqual(
          set(rss.parameters.keys()), set(rss_new.parameters.keys())
      )
      self.assertEqual(
          rss.parameter_distributions, rss_new.parameter_distributions
      )
      # pyre-fixme[16]: `SearchSpace` has no attribute `_environmental_variables`.
      self.assertEqual(
          rss._environmental_variables, rss_new._environmental_variables
      )
      self.assertEqual(
          rss_new.parameters.get("c").parameter_type, ParameterType.INT
      )
  
imports: from copy import deepcopy
  from typing import List, Sized
  import numpy
  from ax.core.observation import ObservationFeatures
  from ax.core.parameter import ChoiceParameter, ParameterType, RangeParameter
  from ax.core.parameter_constraint import ParameterConstraint
  from ax.core.search_space import RobustSearchSpace, SearchSpace
  from ax.modelbridge.transforms.choice_encode import ChoiceEncode, OrderedChoiceEncode
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import checked_cast
  from ax.utils.testing.core_stubs import get_robust_search_space
label_desc: Use image node_id 6 for calling the ChoiceEncodeTransformTest obj's underlying member method code with example usage: obj.test_w_parameter_distributions() without return types