code: def test_distance_factory_1d():
      """Test distance factory works with 1d and 2d."""
      x = create_test_distance_numpy(100)
      y = create_test_distance_numpy(100, random_state=2)
      callable = distance_factory(x, y, metric="dtw")
  
      first = callable(x, y)
  
      x = create_test_distance_numpy(10, 100)
      y = create_test_distance_numpy(10, 100, random_state=2)
  
      second = callable(x, y)
  
      assert first == 14.906015491572047
      assert second == 422.81946268212846
  
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 5 for calling a global function with example usage: test_distance_factory_1d() without return types