code: def test_distance(dist: MetricInfo) -> None:
      """Test distance.
  
      Parameters
      ----------
      dist: MetricInfo
          MetricInfo NamedTuple containing data for distance metric.
      """
      name = dist.canonical_name
      distance_numba_class = dist.dist_instance
      distance_function = dist.dist_func
      distance_factory = distance_numba_class.distance_factory
  
      if not run_test_for_class(distance_function):
          return None
  
      _validate_distance_result(
          x=np.array([10.0]),
          y=np.array([15.0]),
          metric_str=name,
          distance_factory=distance_factory,
          distance_function=distance_function,
          distance_numba_class=distance_numba_class,
          expected_result=_expected_distance_results[name][0],
      )
  
      _validate_distance_result(
          x=create_test_distance_numpy(10),
          y=create_test_distance_numpy(10, random_state=2),
          metric_str=name,
          distance_factory=distance_factory,
          distance_function=distance_function,
          distance_numba_class=distance_numba_class,
          expected_result=_expected_distance_results[name][1],
      )
  
      _validate_distance_result(
          x=create_test_distance_numpy(10, 10),
          y=create_test_distance_numpy(10, 10, random_state=2),
          metric_str=name,
          distance_factory=distance_factory,
          distance_function=distance_function,
          distance_numba_class=distance_numba_class,
          expected_result=_expected_distance_results[name][2],
      )
  
file_path: sktime/sktime/distances/tests/test_numba_distances.py
imports: from typing import Callable
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal
  from sktime.distances._distance import _METRIC_INFOS, distance, distance_factory
  from sktime.distances.base import MetricInfo, NumbaDistance
  from sktime.distances.tests._expected_results import _expected_distance_results
  from sktime.distances.tests._shared_tests import _test_incorrect_parameters, _test_metric_parameters
  from sktime.distances.tests._utils import create_test_distance_numpy
  from sktime.tests.test_switch import run_test_for_class
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 2 for calling a global function with example usage: test_distance(dist) and returns: None