code: def test_w_robust_search_space_multivariate(self) -> None:
      # Error if trying to transform non-normal multivariate distributions.
      rss = get_robust_search_space(multivariate=True)
      rss.parameter_distributions[
          0
      ].distribution_class = "multivariate_t"
      t = self.transform_class(
          search_space=rss,
          observations=[],
      )
      with self.assertRaisesRegex(UnsupportedError, "multivariate"):
          t.transform_search_space(rss)
      # Transform multivariate normal.
      rss = get_robust_search_space(multivariate=True)
      old_params = deepcopy(
          rss.parameter_distributions[0].distribution_parameters
      )
      t = self.transform_class(
          search_space=rss,
          observations=[],
      )
      t.transform_search_space(rss)
      new_params = rss.parameter_distributions[
          0
      ].distribution_parameters
      self.assertIsInstance(new_params["mean"], np.ndarray)
      self.assertIsInstance(new_params["cov"], np.ndarray)
      self.assertTrue(
          np.allclose(
              new_params["mean"],
              np.asarray(old_params["mean"]) / 5.0 * self.target_range,
          )
      )
      self.assertTrue(
          np.allclose(
              new_params["cov"],
              np.asarray(old_params["cov"])
              / ((5.0 / self.target_range) ** 2),
          )
      )
      # Transform multivariate normal environmental distribution.
      rss = get_robust_search_space(multivariate=True)
      rss_params = list(rss.parameters.values())
      rss = RobustSearchSpace(
          parameters=rss_params[2:],
          parameter_distributions=rss.parameter_distributions,
          num_samples=rss.num_samples,
          environmental_variables=rss_params[:2],
      )
      t = self.transform_class(
          search_space=rss,
          observations=[],
      )
      t.transform_search_space(rss)
      new_params = rss.parameter_distributions[
          0
      ].distribution_parameters
      self.assertTrue(
          np.allclose(
              new_params["mean"],
              np.asarray(old_params["mean"]) / 5.0 * self.target_range
              + self.target_lb,
          )
      )
      # Errors if mean / cov are of wrong shape.
      rss.parameter_distributions[0].distribution_parameters["mean"] = [
          1.0
      ]
      with self.assertRaisesRegex(UserInputError, "mean"):
          t.transform_search_space(rss)
      rss.parameter_distributions[0].distribution_parameters["mean"] = [
          1.0,
          1.0,
      ]
      rss.parameter_distributions[0].distribution_parameters["cov"] = [
          1.0
      ]
      with self.assertRaisesRegex(UserInputError, "cov"):
          t.transform_search_space(rss)
  
file_path: Ax/ax/modelbridge/transforms/tests/test_unit_x_transform.py
imports: from copy import deepcopy
  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.exceptions.core import UnsupportedError, UserInputError
  from ax.modelbridge.transforms.unit_x import UnitX
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_robust_search_space
label_desc: Use image node_id 6 for calling the UnitXTransformTest obj's underlying member method code with example usage: obj.test_w_robust_search_space_multivariate() without return types