code: def test_cross_validate(self, mock_init: Mock) -> None:
      # pyre-fixme[20]: Argument `model` expected.
      ma = DiscreteModelBridge()
      model = mock.MagicMock(
          DiscreteModel, autospec=True, instance=True
      )
      model.cross_validate.return_value = (
          np.array([[1.0, -1], [2.0, -2]]),
          np.stack(
              (
                  np.array([[1.0, 4.0], [4.0, 6]]),
                  np.array([[2.0, 5.0], [5.0, 7]]),
              )
          ),
      )
      ma.model = model
      ma.parameters = ["x", "y", "z"]
      ma.outcomes = ["a", "b"]
      observation_data = ma._cross_validate(
          search_space=self.search_space,
          cv_training_data=self.observations,
          cv_test_points=self.observation_features,
      )
      Xs = [
          [[0, "foo", True], [1, "foo", True], [1, "bar", True]],
          [[0, "foo", True], [1, "foo", True]],
      ]
      Ys = [[[1.0], [2.0], [3.0]], [[-1.0], [-2.0]]]
      Yvars = [[[1.0], [2.0], [3.0]], [[6.0], [7.0]]]
      Xtest = [[0, "foo", True], [1, "foo", True], [1, "bar", True]]
      # Transform to arrays:
      model_cv_args = model.cross_validate.mock_calls[0][2]
      for i, x in enumerate(model_cv_args["Xs_train"]):
          self.assertEqual(x, Xs[i])
      for i, y in enumerate(model_cv_args["Ys_train"]):
          self.assertEqual(y, Ys[i])
      for i, v in enumerate(model_cv_args["Yvars_train"]):
          self.assertEqual(v, Yvars[i])
      self.assertEqual(model_cv_args["X_test"], Xtest)
      # Transform from arrays:
      for i, od in enumerate(observation_data):
          self.assertEqual(od, self.observation_data[i])
  
imports: from unittest import mock
  from unittest.mock import Mock
  import numpy
  from ax.core.metric import Metric
  from ax.core.objective import Objective
  from ax.core.observation import Observation, ObservationData, ObservationFeatures
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.outcome_constraint import ComparisonOp, OutcomeConstraint
  from ax.core.parameter import ChoiceParameter, FixedParameter, ParameterType, RangeParameter
  from ax.core.search_space import SearchSpace
  from ax.exceptions.core import UserInputError
  from ax.modelbridge.discrete import _get_parameter_values, DiscreteModelBridge
  from ax.models.discrete_base import DiscreteModel
  from ax.utils.common.testutils import TestCase
label_desc: Use image node_id 5 for calling the DiscreteModelBridgeTest obj's underlying member method code with example usage: obj.test_cross_validate(mock_init) without return types