code: def _aampdist_vect(
      Q,
      T,
      m,
      percentage=0.05,
      k=None,
      custom_func=None,
      p=2.0,
  ):
      """
      Compute the non-normalized (i.e., without z-normalization) matrix profile distance
      measure vector between `Q` and each subsequence, `T[i : i + len(Q)]`, within `T`.
  
      Parameters
      ----------
      Q : numpy.ndarray
          Query array
  
      T : numpy.ndarray
          Time series or sequence
  
      m : int
          Window size
  
      percentage : float, 0.05
          The percentage of distances that will be used to report `mpdist`. The value
          is between 0.0 and 1.0. This parameter is ignored when `k` is not `None` or when
          `custom_func` is not None.
  
      k : int, default None
          Specify the `k`th value in the concatenated matrix profiles to return. When `k`
          is not `None`, then the `percentage` parameter is ignored. This parameter is
          ignored when `custom_func` is not None.
  
      custom_func : function, default None
          A custom user defined function for selecting the desired value from the
          unsorted `P_ABBA` array. This function may need to leverage `functools.partial`
          and should take `P_ABBA` as its only input parameter and return a single
          `MPdist` value. The `percentage` and `k` parameters are ignored when
          `custom_func` is not None.
  
      p : float, default 2.0
          The p-norm to apply for computing the Minkowski distance. Minkowski distance is
          typically used with `p` being 1 or 2, which correspond to the Manhattan distance
          and the Euclidean distance, respectively.
  
      Returns
      -------
      MPdist_vect : numpy.ndarray
          The non-normalized (i.e., without z-normalization) matrix profile distance
          measure vector
      """
      j = Q.shape[0] - m + 1  # `k` is reserved for `P_ABBA` selection
      l = T.shape[0] - m + 1
      MPdist_vect = np.empty(
          T.shape[0] - Q.shape[0] + 1, dtype=np.float64
      )
      distance_matrix = np.full((j, l), np.inf, dtype=np.float64)
      P_ABBA = np.empty(2 * j, dtype=np.float64)
  
      if k is None:
          percentage = np.clip(percentage, 0.0, 1.0)
          k = min(math.ceil(percentage * (2 * Q.shape[0])), 2 * j - 1)
  
      k = min(int(k), P_ABBA.shape[0] - 1)
  
      core._mass_absolute_distance_matrix(Q, T, m, distance_matrix, p=p)
  
      rolling_row_min = core.rolling_nanmin(distance_matrix, j)
      col_min = np.nanmin(distance_matrix, axis=0)
  
      for i in range(MPdist_vect.shape[0]):
          P_ABBA[:j] = rolling_row_min[:, i]
          P_ABBA[j:] = col_min[i : i + j]
          MPdist_vect[i] = core._select_P_ABBA_value(
              P_ABBA, k, custom_func
          )
  
      return MPdist_vect
  
file_path: stumpy/stumpy/aampdist.py
imports: import functools
  import math
  import numpy
  from .None import core
  from .aamp import aamp
  from .aamped import aamped
label_desc: Use image node_id 1 for calling a global function with example usage: _aampdist_vect(Q, T, m, percentage, k, custom_func, p) and returns: MPdist_vect