code: def test_cross_validate_with_non_GP_model(
      self, mock_cv: Mock, mock_diagnostics: Mock
  ) -> None:
      mock_enum = Mock()
      mock_enum.return_value = "fake-modelbridge"
      ms = ModelSpec(
          model_enum=mock_enum,
          model_cv_kwargs={"test_key": "test-value"},
      )
      ms.fit(
          experiment=self.experiment,
          data=self.experiment.trials[0].fetch_data(),
      )
      with warnings.catch_warnings(record=True) as w:
          cv_results, cv_diagnostics = ms.cross_validate()
  
      self.assertEqual(len(w), 1)
      self.assertIn("cannot be cross validated", str(w[0].message))
      self.assertIsNone(cv_results)
      self.assertIsNone(cv_diagnostics)
  
      mock_cv.assert_called_with(
          model="fake-modelbridge", test_key="test-value"
      )
      mock_diagnostics.assert_not_called()
  
imports: import warnings
  from unittest import mock
  from unittest.mock import MagicMock, Mock, patch
  from ax.core.observation import ObservationFeatures
  from ax.exceptions.core import UserInputError
  from ax.modelbridge.factory import get_sobol
  from ax.modelbridge.model_spec import FactoryFunctionModelSpec, ModelSpec
  from ax.modelbridge.modelbridge_utils import extract_search_space_digest
  from ax.modelbridge.registry import Models
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_branin_experiment
  from ax.utils.testing.mock import fast_botorch_optimize
label_desc: Use image node_id 5 for calling the ModelSpecTest obj's underlying member method code with example usage: obj.test_cross_validate_with_non_GP_model(mock_cv, mock_diagnostics) without return types