code: def match(
      Q,
      T,
      M_T=None,
      Σ_T=None,
      max_distance=None,
      max_matches=None,
      atol=1e-8,
      query_idx=None,
      normalize=True,
      p=2.0,
      T_subseq_isfinite=None,
      T_subseq_isconstant=None,
      Q_subseq_isconstant=None,
  ):
      """
      Find all matches of a query `Q` in a time series `T`
  
      The indices of subsequences whose distances to `Q` are less than or equal to
      `max_distance`, sorted by distance (lowest to highest). Around each occurrence an
      exclusion zone is applied before searching for the next.
  
      Parameters
      ----------
      Q : numpy.ndarray
          The query sequence. It doesn't have to be a subsequence of `T`
  
      T : numpy.ndarray
          The time series of interest
  
      M_T : numpy.ndarray, default None
          Sliding mean of time series, `T`
  
      Σ_T : numpy.ndarray, default None
          Sliding standard deviation of time series, `T`
  
      max_distance : float or function, default None
          Maximum distance between `Q` and a subsequence `S` for `S` to be considered a
          match.
          If a function, then it has to be a function of one argument `D`, which will be
          the distance profile of `Q` with `T` (a 1D numpy array of size `n-m+1`).
          If None, this defaults to
          `np.nanmax([np.nanmean(D) - 2 * np.nanstd(D), np.nanmin(D)])` (i.e. at
          least the closest match will be returned).
  
      max_matches : int, default None
          The maximum amount of similar occurrences to be returned. The resulting
          occurrences are sorted by distance, so a value of `10` means that the
          indices of the most similar `10` subsequences is returned. If `None`, then all
          occurrences are returned.
  
      atol : float, default 1e-8
          The absolute tolerance parameter. This value will be added to `max_distance`
          when comparing distances between subsequences.
  
      query_idx : int, default None
          This is the index position along the time series, `T`, where the query
          subsequence, `Q`, is located.
          `query_idx` should only be used when the matrix profile is a self-join and
          should be set to `None` for matrix profiles computed from AB-joins.
          If `query_idx` is set to a specific integer value, then this will help ensure
          that the self-match will be returned first.
  
      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_isfinite : numpy.ndarray
          A boolean array that indicates whether a subsequence in `T` contains a
          `np.nan`/`np.inf` value (False). This parameter is ignored when
          `normalize=True`.
  
      T_subseq_isconstant : numpy.ndarray or function, default None
          A boolean array that indicates whether a subsequence (of length Q) 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.
  
      Q_subseq_isconstant : numpy.ndarray or function, default None
          A boolean array (of size 1) that indicates whether Q is constant (True).
          Alternatively, a custom, user-defined function that returns a boolean
          array that indicates whether a subsequence in `Q` 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
      -------
      out : numpy.ndarray
          The first column consists of distances of subsequences of `T` whose distances
          to `Q` are less than or equal to `max_distance`, sorted by distance (lowest to
          highest). The second column consists of the corresponding indices in `T`.
  
      See Also
      --------
      stumpy.motifs : Discover the top motifs for time series `T`
      stumpy.mmotifs : Discover the top motifs for the multi-dimensional time series `T`
      stumpy.stump : Compute the z-normalized matrix profile
      stumpy.stumped : Compute the z-normalized matrix profile with a distributed dask
          cluster
      stumpy.gpu_stump : Compute the z-normalized matrix profile with one or more GPU
          devices
      stumpy.scrump : Compute an approximate z-normalized matrix profile
  
      Examples
      --------
      >>> import stumpy
      >>> import numpy as np
      >>> stumpy.match(
      ...     np.array([-11.1, 23.4, 79.5, 1001.0]),
      ...     np.array([584., -11., 23., 79., 1001., 0., -19.])
      ...     )
      array([[0.0011129739290248121, 1]], dtype=object)
      """
      Q = core._preprocess(Q)
      T = core._preprocess(T)
  
      if np.any(np.isnan(Q)) or np.any(np.isinf(Q)):  # pragma: no cover
          raise ValueError("Q contains illegal values (NaN or inf)")
  
      m = Q.shape[-1]
      excl_zone = int(np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))
  
      Q_subseq_isconstant = core.process_isconstant(
          Q, m, Q_subseq_isconstant
      )
      T_subseq_isconstant = core.process_isconstant(
          T, m, T_subseq_isconstant
      )
  
      if Q.ndim == 1:
          Q = np.expand_dims(Q, 0)
      if Q_subseq_isconstant.ndim == 1:
          Q_subseq_isconstant = np.expand_dims(Q_subseq_isconstant, 0)
  
      if T.ndim == 1:
          T = np.expand_dims(T, 0)
      if T_subseq_isconstant.ndim == 1:
          T_subseq_isconstant = np.expand_dims(T_subseq_isconstant, 0)
  
      T[np.isinf(T)] = np.nan
      if M_T is None or Σ_T is None:
          M_T, Σ_T = core.compute_mean_std(T, m)
      T[np.isnan(T)] = 0
  
      if len(M_T.shape) == 1:
          M_T = np.expand_dims(M_T, 0)
      if len(Σ_T.shape) == 1:
          Σ_T = np.expand_dims(Σ_T, 0)
  
      d, n = T.shape
      D = np.empty((d, n - m + 1))
      for i in range(d):
          D[i, :] = core.mass(
              Q[i],
              T[i],
              M_T[i],
              Σ_T[i],
              T_subseq_isconstant=T_subseq_isconstant[i],
              Q_subseq_isconstant=Q_subseq_isconstant[i],
              query_idx=query_idx,
          )
      D = np.mean(D, axis=0)
  
      return core._find_matches(
          D,
          excl_zone,
          max_distance=max_distance,
          max_matches=max_matches,
          query_idx=query_idx,
          atol=atol,
      )
  
imports: import warnings
  import numpy
  from .None import config, core
  from .aamp_motifs import aamp_match, aamp_motifs
label_desc: Use image node_id 3 for calling a global function with example usage: match(Q, T, M_T, Σ_T, max_distance, max_matches, atol, query_idx, normalize, p, T_subseq_isfinite, T_subseq_isconstant, Q_subseq_isconstant) and returns: core