code: def ddtw_alignment_path(
      x: np.ndarray,
      y: np.ndarray,
      return_cost_matrix: bool = False,
      window: Union[float, None] = None,
      itakura_max_slope: Union[float, None] = None,
      bounding_matrix: np.ndarray = None,
      compute_derivative=None,
      **kwargs: Any,
  ) -> AlignmentPathReturn:
      r"""Compute the derivative dynamic time warping (DDTW) alignment path.
  
      DDTW is an adaptation of DTW originally proposed in [1]_. DDTW attempts to
      improve on dtw by better account for the 'shape' of the time series.
      This is done by considering y axis data points as higher level features of 'shape'.
      To do this the first derivative of the sequence is taken, and then using this
      derived sequence a dtw computation is done.
  
      The default derivative used is:
  
      .. math::
          D_{x}[q] = \frac{{}(q_{i} - q_{i-1} + ((q_{i+1} - q_{i-1}/2)}{2}
  
      Where q is the original time series and d_q is the derived time series.
  
      Parameters
      ----------
      x: np.ndarray (1d or 2d array)
          First time series.
      y: np.ndarray (1d or 2d array)
          Second time series.
      return_cost_matrix: bool, defaults = False
          Boolean that when true will also return the cost matrix.
      window: float, defaults = None
          Float that is the radius of the sakoe chiba window (if using Sakoe-Chiba
          lower bounding). Value must be between 0. and 1.
      itakura_max_slope: float, defaults = None
          Gradient of the slope for itakura parallelogram (if using Itakura
          Parallelogram lower bounding). Value must be between 0. and 1.
      bounding_matrix: np.ndarray (2d of size mxn where m is len(x) and n is len(y)),
                                      defaults = None
          Custom bounding matrix to use. If defined then other lower_bounding params
          are ignored. The matrix should be structure so that indexes considered in
          bound should be the value 0. and indexes outside the bounding matrix should be
          infinity.
      compute_derivative: Callable[[np.ndarray], np.ndarray],
                              defaults = average slope difference
          Callable that computes the derivative. If none is provided the average of the
          slope between two points used.
      kwargs: Any
          Extra kwargs.
  
      Returns
      -------
      list[tuple]
          List of tuples containing the ddtw alignment path.
      float
          Ddtw distance between x and y.
      np.ndarray (of shape (len(x), len(y)).
          Optional return only given if return_cost_matrix = True.
          Cost matrix used to compute the distance.
  
      Raises
      ------
      ValueError
          If the sakoe_chiba_window_radius is not a float.
          If the itakura_max_slope is not a float.
          If the value of x or y provided is not a numpy array.
          If the value of x or y has more than 2 dimensions.
          If a metric string provided, and is not a defined valid string.
          If a metric object (instance of class) is provided and doesn't inherit from
          NumbaDistance.
          If a resolved metric or compute derivative callable is not no_python compiled.
          If the metric type cannot be determined
          If the compute derivative callable is not no_python compiled.
          If both window and itakura_max_slope are set
  
      References
      ----------
      .. [1] Keogh, Eamonn & Pazzani, Michael. (2002). Derivative Dynamic Time Warping.
          First SIAM International Conference on Data Mining.
          1. 10.1137/1.9781611972719.1.
      """
      if compute_derivative is None:
          from sktime.distances._ddtw_numba import average_of_slope
  
          compute_derivative = average_of_slope
  
      format_kwargs = {
          "window": window,
          "itakura_max_slope": itakura_max_slope,
          "bounding_matrix": bounding_matrix,
          "compute_derivative": compute_derivative,
      }
      format_kwargs = {**format_kwargs, **kwargs}
  
      return distance_alignment_path(
          x,
          y,
          metric="ddtw",
          return_cost_matrix=return_cost_matrix,
          **format_kwargs,
      )
  
imports: from typing import Any, Callable, Union
  import numpy
  from sktime.distances._ddtw import _DdtwDistance
  from sktime.distances._dtw import _DtwDistance
  from sktime.distances._edr import _EdrDistance
  from sktime.distances._erp import _ErpDistance
  from sktime.distances._euclidean import _EuclideanDistance
  from sktime.distances._lcss import _LcssDistance
  from sktime.distances._msm import _MsmDistance
  from sktime.distances._resolve_metric import _resolve_dist_instance, _resolve_metric_to_factory
  from sktime.distances._squared import _SquaredDistance
  from sktime.distances._twe import _TweDistance
  from sktime.distances._wddtw import _WddtwDistance
  from sktime.distances._wdtw import _WdtwDistance
  from sktime.distances.base import AlignmentPathReturn, DistanceAlignmentPathCallable, DistanceCallable, MetricInfo, NumbaDistance
label_desc: Use image node_id 14 for calling a global function with example usage: ddtw_alignment_path(x, y, return_cost_matrix, window, itakura_max_slope, bounding_matrix, compute_derivative) and returns: distance_alignment_path