code: def _multi_distance_profile(
      query_idx,
      T_A,
      T_B,
      m,
      M_T,
      Σ_T,
      μ_Q,
      σ_Q,
      T_subseq_isconstant,
      Q_subseq_isconstant,
      include=None,
      discords=False,
      excl_zone=None,
  ):
      """
      Multi-dimensional wrapper to compute the multi-dimensional 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`.
  
      Parameters
      ----------
      query_idx : int
          The start index of the (multi-dimensional) query subsequence in `T_B`
  
      T_A : numpy.ndarray
          The time series or sequence for which the multi-dimensional distance profile
          is computed
  
      T_B : numpy.ndarray
          The time series or sequence that contains your query subsequences
  
      m : int
          Window size
  
      M_T : numpy.ndarray
          Sliding mean for `T_A`
  
      Σ_T : numpy.ndarray
          Sliding standard deviation for `T_A`
  
      μ_Q : numpy.ndarray
          Sliding mean for the query subsequence `T_B`
  
      σ_Q : numpy.ndarray
          Sliding standard deviation for the query subsequence `T_B`
  
      T_subseq_isconstant : numpy.ndarray
          A boolean array that indicates whether a subsequence in `T_A` is constant (True)
  
      Q_subseq_isconstant : numpy.ndarray
          A boolean array that indicates whether the subsequence in `T_B` is
          constant (True)
  
      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, default None
          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(
          T_B[:, query_idx : query_idx + m],
          T_A,
          m,
          M_T,
          Σ_T,
          μ_Q[:, query_idx],
          σ_Q[:, query_idx],
          T_subseq_isconstant,
          np.expand_dims(Q_subseq_isconstant[:, query_idx], 1),
          query_idx=query_idx,
      )
  
      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/mstump.py
imports: from functools import lru_cache, partial
  import numpy
  from numba import njit, prange
  from scipy.stats import norm
  from .None import config, core
  from .maamp import maamp, maamp_mdl, maamp_multi_distance_profile, maamp_subspace
label_desc: Use image node_id 6 for calling a global function with example usage: _multi_distance_profile(query_idx, T_A, T_B, m, M_T, Σ_T, μ_Q, σ_Q, T_subseq_isconstant, Q_subseq_isconstant, include, discords, excl_zone) and returns: D