code: def _maamp_multi_distance_profile(
      query_idx,
      T_A,
      T_B,
      m,
      T_B_subseq_isfinite,
      p=2.0,
      include=None,
      discords=False,
      excl_zone=None,
  ):
      """
      Multi-dimensional wrapper to compute the multi-dimensional non-normalized (i.e.,
      without z-normalization) distance profile for a given query window within the
      times series or sequence that is denoted by the `query_idx` index. Essentially,
      this is a convenience wrapper around `_multi_mass_absolute`.
  
      Parameters
      ----------
      query_idx : int
          The window index to calculate the multi-dimensional distance profile
  
      T_A : numpy.ndarray
          The time series or sequence for which the multi-dimensional distance profile
          will be returned
  
      T_B : numpy.ndarray
          The time series or sequence that contains your query subsequences
  
      m : int
          Window size
  
      T_B_subseq_isfinite : numpy.ndarray
          A boolean array that indicates whether a subsequence in `T_B` contains a
          `np.nan`/`np.inf` value (False)
  
      p : float
          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.
  
      include : numpy.ndarray, default None
          A list of (zero-based) indices corresponding to the dimensions in `T` that
          must be included in the constrained multidimensional motif search.
          For more information, see Section IV D in:
  
          `DOI: 10.1109/ICDM.2017.66 \
          <https://www.cs.ucr.edu/~eamonn/Motif_Discovery_ICDM.pdf>`__
  
      discords : bool, default False
          When set to `True`, this reverses the distance profile to favor discords rather
          than motifs. Note that indices in `include` are still maintained and respected.
  
      excl_zone : int
          The half width for the exclusion zone relative to the `query_idx`.
  
      Returns
      -------
      D : numpy.ndarray
          Multi-dimensional distance profile for the window with index equal to
          `query_idx`
      """
      d, n = T_A.shape
      l = n - m + 1
      start_row_idx = 0
      D = _multi_mass_absolute(
          T_B[:, query_idx : query_idx + m],
          T_A,
          m,
          T_B_subseq_isfinite[:, query_idx],
          T_B_subseq_isfinite,
          p,
      )
  
      if include is not None:
          core._apply_include(D, include)
          start_row_idx = include.shape[0]
  
      if discords:
          D[start_row_idx:][::-1].sort(axis=0, kind="mergesort")
      else:
          D[start_row_idx:].sort(axis=0, kind="mergesort")
  
      D_prime = np.zeros(l, dtype=np.float64)
      for i in range(d):
          D_prime[:] = D_prime + D[i]
          D[i, :] = D_prime / (i + 1)
  
      if excl_zone is not None:
          core.apply_exclusion_zone(D, query_idx, excl_zone, np.inf)
  
      return D
  
file_path: stumpy/stumpy/maamp.py
imports: from functools import partial
  import numpy
  from numba import njit, prange
  from .None import config, core
label_desc: Use image node_id 5 for calling a global function with example usage: _maamp_multi_distance_profile(query_idx, T_A, T_B, m, T_B_subseq_isfinite, p, include, discords, excl_zone) and returns: D