code: def multi_distance_profile(
      query_idx,
      T,
      m,
      include=None,
      discords=False,
      normalize=True,
      p=2.0,
      T_subseq_isconstant=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.
  
      Parameters
      ----------
      query_idx : int
          The window index to calculate the multi-dimensional distance profile for
  
      T : numpy.ndarray
          The multi-dimensional time series or sequence for which the multi-dimensional
          distance profile will be returned
  
      m : int
          Window size
  
      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.
  
      normalize : bool, default True
          When set to `True`, this z-normalizes subsequences prior to computing distances.
          Otherwise, this function gets re-routed to its complementary non-normalized
          equivalent set in the `@core.non_normalized` function decorator.
  
      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. This parameter is ignored when
          `normalize == True`.
  
      T_subseq_isconstant : numpy.ndarray, function, or list, default None
          A parameter that is used to show whether a subsequence of a time series in `T`
          is constant (True) or not. T_subseq_isconstant can be a 2D boolean numpy.ndarry
          or a function that can be applied to each time series in `T`. Alternatively, for
          maximum flexibility, a list (with length equal to the total number of time
          series) may also be used. In this case, T_subseq_isconstant[i] corresponds to
          the i-th time series T[i] and each element in the list can either be a 1D
          boolean np.ndarray, a function, or None.
  
      Returns
      -------
      D : numpy.ndarray
          Multi-dimensional distance profile for the window with index equal to
          `query_idx`
      """
      T, M_T, Σ_T, T_subseq_isconstant = core.preprocess(
          T, m, T_subseq_isconstant=T_subseq_isconstant
      )
  
      if T.ndim <= 1:  # pragma: no cover
          err = f"T is {T.ndim}-dimensional and must be at least 1-dimensional"
          raise ValueError(f"{err}")
  
      core.check_window_size(m, max_size=T.shape[1])
  
      if include is not None:  # pragma: no cover
          include = core._preprocess_include(include)
  
      excl_zone = int(
          np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM)
      )  # See Definition 3 and Figure 3
  
      D = _multi_distance_profile(
          query_idx,
          T,
          T,
          m,
          M_T,
          Σ_T,
          M_T,
          Σ_T,
          T_subseq_isconstant,
          T_subseq_isconstant,
          include,
          discords,
          excl_zone,
      )
  
      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 7 for calling a global function with example usage: multi_distance_profile(query_idx, T, m, include, discords, normalize, p, T_subseq_isconstant) and returns: D