code: def maamp_mdl(
      T,
      m,
      subseq_idx,
      nn_idx,
      include=None,
      discords=False,
      discretize_func=None,
      n_bit=8,
      p=2.0,
  ):
      """
      Compute the multi-dimensional number of bits needed to compress one
      multi-dimensional subsequence with another along each of the k-dimensions
      using the minimum description length (MDL)
  
      Parameters
      ----------
      T : numpy.ndarray
          The time series or sequence for which the multi-dimensional matrix profile,
          multi-dimensional matrix profile indices were computed
  
      m : int
          Window size
  
      subseq_idx : numpy.ndarray
          The multi-dimensional subsequence indices in T
  
      nn_idx : numpy.ndarray
          The multi-dimensional nearest neighbor index in T
  
      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.
  
      discretize_func : func, default None
          A function for discretizing each input array. When this is `None`, an
          appropriate discretization function (based on the `normalization` parameter)
          will be applied.
  
      n_bit : int, default 8
          The number of bits used for discretization and for computing the bit size. For
          more information on an appropriate value, see Figure 4 in:
  
          `DOI: 10.1109/ICDM.2016.0069 \
          <https://www.cs.ucr.edu/~eamonn/PID4481999_Matrix%20Profile_III.pdf>`__
  
          and Figure 2 in:
  
          `DOI: 10.1109/ICDM.2011.54 \
          <https://www.cs.ucr.edu/~eamonn/ICDM_mdl.pdf>`__
  
      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.
  
      Returns
      -------
      bit_sizes : numpy.ndarray
          The total number of bits computed from MDL for representing each pair of
          multidimensional subsequences.
  
      S : list
          A list of numpy.ndarrays that contains the `k`th-dimensional subspaces
      """
      T = core._preprocess(T)
      core.check_window_size(m, max_size=T.shape[-1])
  
      if discretize_func is None:
          T_isfinite = np.isfinite(T)
          T_min = T[T_isfinite].min()
          T_max = T[T_isfinite].max()
          discretize_func = partial(
              _maamp_discretize, a_min=T_min, a_max=T_max, n_bit=n_bit
          )
  
      bit_sizes = np.empty(T.shape[0])
      S = [None] * T.shape[0]
      for k in range(T.shape[0]):
          subseqs, _ = core.preprocess_non_normalized(
              T[:, subseq_idx[k] : subseq_idx[k] + m], m
          )
          neighbors, _ = core.preprocess_non_normalized(
              T[:, nn_idx[k] : nn_idx[k] + m], m
          )
  
          disc_subseqs = discretize_func(subseqs)
          disc_neighbors = discretize_func(neighbors)
  
          D = np.linalg.norm(
              disc_subseqs - disc_neighbors, axis=1, ord=p
          )
  
          S[k] = core._subspace(
              D, k, include=include, discords=discords
          )
          bit_sizes[k] = core._mdl(
              disc_subseqs, disc_neighbors, S[k], n_bit=n_bit
          )
  
      return bit_sizes, S
  
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 4 for calling a global function with example usage: maamp_mdl(T, m, subseq_idx, nn_idx, include, discords, discretize_func, n_bit, p) and returns: bit_sizes,  S