code: def wdtw_distance(
      x: np.ndarray,
      y: np.ndarray,
      window: Union[float, None] = None,
      itakura_max_slope: Union[float, None] = None,
      bounding_matrix: np.ndarray = None,
      g: float = 0.05,
      **kwargs: Any,
  ) -> float:
      """Compute the weighted dynamic time warping (WDTW) distance between time series.
  
      First proposed in [1]_, WDTW adds a  adds a multiplicative weight penalty based on
      the warping distance. This means that time series with lower phase difference have
      a smaller weight imposed (i.e less penalty imposed) and time series with larger
      phase difference have a larger weight imposed (i.e. larger penalty imposed).
  
      Formally this can be described as:
  
      .. math::
          d_{w}(x_{i}, y_{j}) = ||w_{|i-j|}(x_{i} - y_{j})||
  
      Where d_w is the distance with a the weight applied to it for points i, j, where
      w(|i-j|) is a positive weight between the two points x_i and y_j.
  
  
      Parameters
      ----------
      x: np.ndarray (1d or 2d array)
          First time series.
      y: np.ndarray (1d or 2d array)
          Second time series.
      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.
      g: float, defaults = 0.
          Constant that controls the curvature (slope) of the function; that is, g
          controls the level of penalisation for the points with larger phase
          difference.
      kwargs: Any
          Extra kwargs.
  
      Returns
      -------
      float
          Wdtw distance between the x and y.
  
      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 the metric type cannot be determined
          If both window and itakura_max_slope are set
  
      Examples
      --------
      >>> import numpy as np
      >>> from sktime.distances import wdtw_distance
      >>> x_1d = np.array([1, 2, 3, 4])  # 1d array
      >>> y_1d = np.array([5, 6, 7, 8])  # 1d array
      >>> wdtw_distance(x_1d, y_1d)
      27.975712863958133
  
      >>> x_2d = np.array([[1, 2, 3, 4], [5, 6, 7, 8]])  # 2d array
      >>> y_2d = np.array([[9, 10, 11, 12], [13, 14, 15, 16]])  # 2d array
      >>> wdtw_distance(x_2d, y_2d)
      243.2106560107827
  
      References
      ----------
      .. [1] Young-Seon Jeong, Myong K. Jeong, Olufemi A. Omitaomu, Weighted dynamic time
      warping for time series classification, Pattern Recognition, Volume 44, Issue 9,
      2011, Pages 2231-2240, ISSN 0031-3203, https://doi.org/10.1016/j.patcog.2010.09.022.
      """
      format_kwargs = {
          "window": window,
          "itakura_max_slope": itakura_max_slope,
          "bounding_matrix": bounding_matrix,
          "g": g,
      }
      format_kwargs = {**format_kwargs, **kwargs}
  
      return distance(x, y, metric="wdtw", **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 5 for calling a global function with example usage: wdtw_distance(x, y, window, itakura_max_slope, bounding_matrix, g) and returns: distance