code: def _validate_distance_alignment_path_result(
      x: np.ndarray,
      y: np.ndarray,
      metric_str: str,
      distance_path_callable,
      kwargs_dict: dict = None,
  ):
      if kwargs_dict is None:
          kwargs_dict = {}
  
      metric_str_result = distance_alignment_path(
          x, y, metric=metric_str, **kwargs_dict
      )
      assert isinstance(metric_str_result, tuple), (
          f"The result for a distance path using the string: {metric_str} as the "
          f'"metric" parameter should return a tuple. The return type provided is of '
          f"type {type(metric_str_result)}"
      )
      assert len(metric_str_result) == 2
  
      assert isinstance(metric_str_result[0], list), (
          f"The result for a distance path first return using the string: {metric_str} as"
          f" the metric parameter should return a tuple. The return type provided is of "
          f"type {type(metric_str_result)}"
      )
  
      assert isinstance(metric_str_result[1], float), (
          f"The result for a distance path first return using the string: {metric_str} as"
          f" the metric parameter should return a tuple. The return type provided is of "
          f"type {type(metric_str_result)}"
      )
  
      distance_result = distance(x, y, metric=metric_str)
      path_result = distance_path_callable(x, y)
  
      assert distance_result == metric_str_result[1]
      assert distance_result == path_result[1]
  
      metric_str_result_cm = distance_alignment_path(
          x,
          y,
          metric=metric_str,
          return_cost_matrix=True,
          **kwargs_dict,
      )
  
      assert isinstance(metric_str_result_cm, tuple), (
          f"The result for a distance path using the string: {metric_str} as the "
          f'"metric" parameter should return a tuple. The return type provided is of '
          f"type {type(metric_str_result)}"
      )
      assert len(metric_str_result_cm) == 3
  
      assert isinstance(metric_str_result_cm[0], list), (
          f"The result for a distance path first return using the string: {metric_str} as"
          f" the metric parameter should return a tuple. The return type provided is of "
          f"type {type(metric_str_result_cm[0])}"
      )
  
      assert isinstance(metric_str_result_cm[1], float), (
          f"The result for a distance path first return using the string: {metric_str} as"
          f" the metric parameter should return a tuple. The return type provided is of "
          f"type {type(metric_str_result)}"
      )
      assert metric_str_result_cm[0] == metric_str_result[0]
      assert metric_str_result_cm[1] == metric_str_result[1]
  
imports: import numpy
  import pytest
  from sktime.distances._distance import _METRIC_INFOS, distance, distance_alignment_path
  from sktime.distances.tests._utils import create_test_distance_numpy
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_distance_alignment_path_result(x, y, metric_str, distance_path_callable, kwargs_dict) without return types