code: def _get_all_profiles(
      T,
      m,
      percentage=1.0,
      s=None,
      mpdist_percentage=0.05,
      mpdist_k=None,
      mpdist_custom_func=None,
      mpdist_T_subseq_isconstant=None,
  ):
      """
      For each non-overlapping subsequence, `S[i]`, in `T`, compute the matrix profile
      distance measure vector between the `i`th non-overlapping subsequence and each
      sliding window subsequence, `T[j : j + m]`, within `T` where `j < len(T) - m + 1`.
  
      Parameters
      ----------
      T : numpy.ndarray
          The time series or sequence for which to find the snippets
  
      m : int
          The window size for each non-overlapping subsequence, `S[i]`.
  
      percentage : float, default 1.0
          With the length of each non-overlapping subsequence, `S[i]`, set to `m`, this
          is the percentage of `S[i]` (i.e., `percentage * m`) to set the `s` to. When
          `percentage == 1.0`, then the full length of `S[i]` is used to compute the
          `mpdist_vect`. When `percentage < 1.0`, then shorter subsequences from `S[i]`
          is used to compute `mpdist_vect`.
  
      s : int, default None
          With the length of each non-overlapping subsequence, `S[i]`, set to `m`, this
          is essentially the sub-subsequence length (i.e., a shorter part of `S[i]`).
          When `s == m`, then the full length of `S[i]` is used to compute the
          `mpdist_vect`. When `s < m`, then shorter subsequences with length `s` from
          each `S[i]` is used to compute `mpdist_vect`. When `s` is not `None`, then
          the `percentage` parameter is ignored.
  
      mpdist_percentage : float, default 0.05
          The percentage of distances that will be used to report `mpdist`. The value
          is between 0.0 and 1.0.
  
      mpdist_k : int
          Specify the `k`th value in the concatenated matrix profiles to return. When
          `mpdist_k` is not `None`, then the `mpdist_percentage` parameter is ignored.
  
      mpdist_custom_func : func, default None
          A custom user defined function for selecting the desired value from the
          sorted `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
          `mpdist_custom_func` is not None.
  
      mpdist_T_subseq_isconstant : numpy.ndarray or function, default None
          A boolean array that indicates whether a subsequence (of length `s`) in `T`
          is constant (True). Alternatively, a custom, user-defined function that
          returns a boolean array that indicates whether a subsequence in `T` is
          constant (True). The function must only take two arguments, `a`, a 1-D array,
          and `w`, the window size, while additional arguments may be specified
          by currying the user-defined function using `functools.partial`. Any
          subsequence with at least one np.nan/np.inf will automatically have its
          corresponding value set to False in this boolean array.
  
      Returns
      -------
      D : numpy.ndarray
          MPdist profiles
  
      Notes
      -----
      `DOI: 10.1109/ICBK.2018.00058 \
      <https://www.cs.ucr.edu/~eamonn/Time_Series_Snippets_10pages.pdf>`__
  
      See Table II
      """
      if m > T.shape[0] // 2:  # pragma: no cover
          raise ValueError(
              f"The window size {m} for each non-overlapping subsequence is too large "
              f"for a time series with length {T.shape[0]}. "
              f"Please try `m <= len(T) // 2`."
          )
  
      if s is not None:
          s = min(int(s), m)
      else:
          percentage = np.clip(percentage, 0.0, 1.0)
          s = min(math.ceil(percentage * m), m)
  
      right_pad = 0
      T_subseq_isconstant = core.process_isconstant(
          T, s, mpdist_T_subseq_isconstant
      )
      n_contiguous_windows = int(T.shape[0] // m)
      if T.shape[0] % m != 0:
          right_pad = int(m * np.ceil(T.shape[0] / m) - T.shape[0])
          pad_width = (0, right_pad)
          T = np.pad(
              T, pad_width, mode="constant", constant_values=np.nan
          )
          T_subseq_isconstant = np.pad(
              T_subseq_isconstant,
              pad_width,
              mode="constant",
              constant_values=False,
          )
  
      n_padded = T.shape[0]
      D = np.empty(
          (n_contiguous_windows, n_padded - m + 1), dtype=np.float64
      )
  
      M_T, Σ_T = core.compute_mean_std(T, s)
  
      # Iterate over non-overlapping subsequences, see Definition 3
      for i in range(n_contiguous_windows):
          start = i * m
          stop = (i + 1) * m
          S_i = T[start:stop]
          D[i, :] = _mpdist_vect(
              S_i,
              T,
              s,
              M_T[start : stop - s + 1],
              Σ_T[start : stop - s + 1],
              M_T,
              Σ_T,
              T_subseq_isconstant[start : stop - s + 1],
              T_subseq_isconstant,
              percentage=mpdist_percentage,
              k=mpdist_k,
              custom_func=mpdist_custom_func,
              query_idx=start,
          )
  
      stop_idx = n_padded - m + 1 - right_pad
      D = D[:, :stop_idx]
  
      return D
  
file_path: stumpy/stumpy/snippets.py
imports: import math
  import numpy
  from .None import core
  from .aampdist_snippets import aampdist_snippets
  from .core import _get_mask_slices, check_window_size
  from .mpdist import _mpdist_vect
label_desc: Use image node_id 1 for calling a global function with example usage: _get_all_profiles(T, m, percentage, s, mpdist_percentage, mpdist_k, mpdist_custom_func, mpdist_T_subseq_isconstant) and returns: D