code: def _preprocess_prescrump(
      T_A,
      m,
      T_B=None,
      s=None,
      T_A_subseq_isconstant=None,
      T_B_subseq_isconstant=None,
  ):
      """
      Performs several preprocessings and returns outputs that are needed for the
      prescrump algorithm.
  
      Parameters
      ----------
      T_A : numpy.ndarray
          The time series or sequence for which to compute the matrix profile
  
      m : int
          Window size
  
      T_B : numpy.ndarray, default None
          The time series or sequence that will be used to annotate T_A. For every
          subsequence in T_A, its nearest neighbor in T_B will be recorded.
  
      s : int, default None
          The sampling interval that defaults to
          `int(np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))`
  
      T_A_subseq_isconstant : numpy.ndarray or function, default None
          A boolean array that indicates whether a subsequence in `T_A` is constant
          (True). Alternatively, a custom, user-defined function that returns a
          boolean array that indicates whether a subsequence in `T_A` 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.
  
      T_B_subseq_isconstant : numpy.ndarray or function, default None
          A boolean array that indicates whether a subsequence in `T_B` is constant
          (True). Alternatively, a custom, user-defined function that returns a
          boolean array that indicates whether a subsequence in `T_B` 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
      -------
      T_A : numpy.ndarray
          A copy of the time series input `T_A`, where all NaN and inf values
          are replaced with zero.
  
      T_B : numpy.ndarray
          A copy of the time series input `T_B`, where all NaN and inf values
          are replaced with zero. If the input `T_B` is not provided (default),
          this array is just a copy of `T_A`.
  
      μ_Q : numpy.ndarray
          Sliding window mean for `T_A`
  
      σ_Q : numpy.ndarray
          Sliding window standard deviation for `T_A`
  
      M_T : numpy.ndarray
          Sliding window mean for `T_B`
  
      Σ_T : numpy.ndarray
          Sliding window standard deviation for `T_B`
  
      Q_subseq_isconstant : numpy.ndarray
          A boolean array that indicates whether the subsequence in `Q` is constant (True)
  
      T_subseq_isconstant : numpy.ndarray
          A boolean array that indicates whether a subsequence in `T` is constant (True)
  
      indices : numpy.ndarray
          The subsequence indices to compute `prescrump` for
  
      s : int
          The sampling interval that defaults to
          `int(np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))`
  
      excl_zone : int
          The half width for the exclusion zone
      """
      if T_B is None:
          T_B = T_A
          T_B_subseq_isconstant = T_A_subseq_isconstant
          excl_zone = int(np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))
      else:
          excl_zone = None
  
      T_A, μ_Q, σ_Q, Q_subseq_isconstant = core.preprocess(
          T_A, m, T_subseq_isconstant=T_A_subseq_isconstant
      )
      T_B, M_T, Σ_T, T_subseq_isconstant = core.preprocess(
          T_B, m, T_subseq_isconstant=T_B_subseq_isconstant
      )
  
      n_A = T_A.shape[0]
      l = n_A - m + 1
  
      if s is None:  # pragma: no cover
          if excl_zone is not None:  # self-join
              s = excl_zone
          else:  # AB-join
              s = int(np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))
  
      indices = np.random.permutation(range(0, l, s)).astype(np.int64)
  
      return (
          T_A,
          T_B,
          μ_Q,
          σ_Q,
          M_T,
          Σ_T,
          Q_subseq_isconstant,
          T_subseq_isconstant,
          indices,
          s,
          excl_zone,
      )
  
file_path: stumpy/stumpy/scrump.py
imports: import numba
  import numpy
  from numba import njit, prange
  from .None import config, core
  from .scraamp import prescraamp, scraamp
  from .stump import _stump
label_desc: Use image node_id 1 for calling a global function with example usage: _preprocess_prescrump(T_A, m, T_B, s, T_A_subseq_isconstant, T_B_subseq_isconstant) and returns: T_A,  T_B,  μ_Q,  σ_Q,  M_T,  Σ_T,  Q_subseq_isconstant,  T_subseq_isconstant,  indices,  s,  excl_zone