code: def ostinato(Ts, m, normalize=True, p=2.0, Ts_subseq_isconstant=None):
      """
      Find the z-normalized consensus motif of multiple time series
  
      This is a wrapper around the vanilla version of the ostinato algorithm
      which finds the best radius and a helper function that finds the most
      central conserved motif.
  
      Parameters
      ----------
      Ts : list
          A list of time series for which to find the most central consensus motif
  
      m : int
          Window size
  
      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`.
  
      Ts_subseq_isconstant : list, default None
          A list of rolling window isconstant for each time series in `Ts`.
  
      Returns
      -------
      central_radius : float
          Radius of the most central consensus motif
  
      central_Ts_idx : int
          The time series index in `Ts` which contains the most central consensus motif
  
      central_subseq_idx : int
          The subsequence index within time series `Ts[central_motif_Ts_idx]` the contains
          most central consensus motif
  
      See Also
      --------
      stumpy.ostinatoed : Find the z-normalized consensus motif of multiple time series
          with a distributed cluster
      stumpy.gpu_ostinato : Find the z-normalized consensus motif of multiple time series
          with one or more GPU devices
  
      Notes
      -----
      `DOI: 10.1109/ICDM.2019.00140 \
      <https://www.cs.ucr.edu/~eamonn/consensus_Motif_ICDM_Long_version.pdf>`__
  
      See Table 2
  
      The ostinato algorithm proposed in the paper finds the best radius
      in `Ts`. Intuitively, the radius is the minimum distance of a
      subsequence to encompass at least one nearest neighbor subsequence
      from all other time series. The best radius in `Ts` is the minimum
      radius amongst all radii. Some data sets might contain multiple
      subsequences which have the same optimal radius.
      The greedy Ostinato algorithm only finds one of them, which might
      not be the most central motif. The most central motif amongst the
      subsequences with the best radius is the one with the smallest mean
      distance to nearest neighbors in all other time series. To find this
      central motif it is necessary to search the subsequences with the
      best radius via `stumpy.ostinato._get_central_motif`
  
      Examples
      --------
      >>> import stumpy
      >>> import numpy as np
      >>> stumpy.ostinato(
      ...     [np.array([584., -11., 23., 79., 1001., 0., 19.]),
      ...      np.array([600., -10., 23., 17.]),
      ...      np.array([  1.,   9.,  6.,  0.])],
      ...     m=3)
      (1.2370237678153826, 0, 4)
      """
      if not isinstance(Ts, list):  # pragma: no cover
          raise ValueError(
              f"`Ts` is of type `{type(Ts)}` but a `list` is expected"
          )
  
      M_Ts = [None] * len(Ts)
      Σ_Ts = [None] * len(Ts)
      if Ts_subseq_isconstant is None:
          Ts_subseq_isconstant = [None] * len(Ts)
      for i, T in enumerate(Ts):
          (
              Ts[i],
              M_Ts[i],
              Σ_Ts[i],
              Ts_subseq_isconstant[i],
          ) = core.preprocess(
              T, m, T_subseq_isconstant=Ts_subseq_isconstant[i]
          )
  
      bsf_radius, bsf_Ts_idx, bsf_subseq_idx = _ostinato(
          Ts, m, M_Ts, Σ_Ts, Ts_subseq_isconstant
      )
  
      (
          central_radius,
          central_Ts_idx,
          central_subseq_idx,
      ) = _get_central_motif(
          Ts,
          bsf_radius,
          bsf_Ts_idx,
          bsf_subseq_idx,
          m,
          M_Ts,
          Σ_Ts,
          Ts_subseq_isconstant,
      )
  
      return central_radius, central_Ts_idx, central_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 4 for calling a global function with example usage: ostinato(Ts, m, normalize, p, Ts_subseq_isconstant) and returns: central_radius,  central_Ts_idx,  central_subseq_idx