code: def _test_incorrect_parameters(distance_func: Callable):
      """Test to ensure correct errors thrown."""
      numpy_x = create_test_distance_numpy(10, 10)
      numpy_y = create_test_distance_numpy(10, 10, random_state=2)
  
      numpy_4d = np.array([[[[1, 2, 3]]]])
  
      class _InvalidTestClass:
          @staticmethod
          @njit()
          def _numba_distance(x, y, **kwargs) -> float:
              return 5.0
  
          def _distance_factory(
              self, x: np.ndarray, y: np.ndarray, **kwargs: dict
          ) -> DistanceCallable:
              return self._numba_distance
  
      with pytest.raises(ValueError):  # Invalid metric string
          distance_func(numpy_x, numpy_y, metric="fake")
  
      with pytest.raises(ValueError):  # Invalid dimensions x
          distance_func(numpy_4d, numpy_y, metric="euclidean")
  
      with pytest.raises(ValueError):  # Invalid dimensions y
          distance_func(numpy_x, numpy_4d, metric="euclidean")
  
      with pytest.raises(
          ValueError
      ):  # Object that doesn't inherit NumbaDistance
          distance_func(numpy_x, numpy_y, metric=_InvalidTestClass())
  
imports: from typing import Callable
  import numpy
  import pytest
  from sktime.distances.base import DistanceCallable, NumbaDistance
  from sktime.distances.tests._utils import create_test_distance_numpy
  from sktime.utils.numba.njit import njit
label_desc: Use image node_id 2 for calling a global function with example usage: _test_incorrect_parameters(distance_func) and returns: int, self