code: def _across_series_nearest_neighbors(
      Ts, Ts_idx, subseq_idx, m, M_Ts, Σ_Ts, Ts_subseq_isconstant
  ):
      """
      For multiple time series find, per individual time series, the subsequences closest
      to a given query.
  
      Parameters
      ----------
      Ts : list
          A list of time series for which to find the nearest neighbor subsequences that
          are closest to the query subsequence `Ts[Ts_idx][subseq_idx : subseq_idx + m]`
  
      Ts_idx : int
          The index of time series in `Ts` which contains the query subsequence
  
      subseq_idx : int
          The subsequence index in the time series `Ts[Ts_idx]` that contains the query
          subsequence
  
      m : int
          Window size
  
      M_Ts : list
          A list of rolling window means for each time series in `Ts`
  
      Σ_Ts : list
          A list of rolling window standard deviations for each time series in `Ts`
  
      Ts_subseq_isconstant : list
          A list of rolling window isconstant for each time series in `Ts`
  
      Returns
      -------
      nns_radii : numpy.ndarray
          Radii to subsequences in each time series of `Ts` that are closest to the
          query subsequence `Ts[Ts_idx][subseq_idx : subseq_idx + m]`
  
      nns_subseq_idx : numpy.ndarray
          Indices to subsequences in each time series of `Ts` that are closest to the
          query subsequence `Ts[Ts_idx][subseq_idx : subseq_idx + m]`
      """
      k = len(Ts)
      Q = Ts[Ts_idx][subseq_idx : subseq_idx + m]
      nns_radii = np.zeros(k, dtype=np.float64)
      nns_subseq_idx = np.zeros(k, dtype=np.int64)
  
      for i in range(k):
          QT = core.sliding_dot_product(
              Ts[Ts_idx][subseq_idx : subseq_idx + m], Ts[i]
          )
          distance_profile = core._mass(
              Q,
              Ts[i],
              QT,
              M_Ts[Ts_idx][subseq_idx],
              Σ_Ts[Ts_idx][subseq_idx],
              M_Ts[i],
              Σ_Ts[i],
              Ts_subseq_isconstant[Ts_idx][subseq_idx],
              Ts_subseq_isconstant[i],
          )
          nns_subseq_idx[i] = np.argmin(distance_profile)
          nns_radii[i] = distance_profile[nns_subseq_idx[i]]
  
      return nns_radii, nns_subseq_idx
  
file_path: stumpy/stumpy/ostinato.py
imports: import numpy
  from .None import core
  from .aamp_ostinato import aamp_ostinato, aamp_ostinatoed
  from .stump import stump
  from .stumped import stumped
label_desc: Use image node_id 1 for calling a global function with example usage: _across_series_nearest_neighbors(Ts, Ts_idx, subseq_idx, m, M_Ts, Σ_Ts, Ts_subseq_isconstant) and returns: nns_radii,  nns_subseq_idx