docstr: Detect anomalies from given time series.
  
  Parameters
  ----------
  ts: pandas.Series or pandas.DataFrame
      Time series to detect anomalies from. If a DataFrame with k
      columns, it is treated as k independent univariate time series, and
      the detector will be applied to each univariate series
      independently.
  
  return_list: bool, optional
      Whether to return a list of anomalous events, or a binary series
      indicating normal/anomalous. Default: False.
  
  Returns
  -------
  pandas.Series, pandas.DataFrame, list, or dict
      Detected anomalies.
  
      - If input is a Series and return_list=False, return a Series;
      - If input is a DataFrame and return_list=False, return a
        DataFrame, where each column corresponds a column in input;
      - If input is a Series and return_list=True, return a list of time
        stamps or time stamp tuples;
      - If input is a DataFrame and return_list=True, return a dict of
        lists, where each key-value pair corresponds a column in input.
docstr_tok: ["Detect","anomalies","from","given","time","series",".","Parameters","--","--","--","--","--","ts",":","pandas.Series","or","pandas.DataFrame","Time","series","to","detect","anomalies","from",".","If","a","DataFrame","with","k","columns",",","it","is","treated","as","k","independent","univariate","time","series",",","and","the","detector","will","be","applied","to","each","univariate","series","independently",".","return_list",":","bool",",","optional","Whether","to","return","a","list","of","anomalous","events",",","or","a","binary","series","indicating","normal\/anomalous",".","Default",":","False",".","Returns","--","--","--","-","pandas.Series",",","pandas.DataFrame",",","list",",","or","dict","Detected","anomalies",".","-","If","input","is","a","Series","and","return_list=False",",","return","a","Series",";","-","If","input","is","a","DataFrame","and","return_list=False",",","return","a","DataFrame",",","where","each","column","corresponds","a","column","in","input",";","-","If","input","is","a","Series","and","return_list=True",",","return","a","list","of","time","stamps","or","time","stamp","tuples",";","-","If","input","is","a","DataFrame","and","return_list=True",",","return","a","dict","of","lists",",","where","each","key-value","pair","corresponds","a","column","in","input","."]
code: def predict(
      self,
      ts: Union[pd.Series, pd.DataFrame],
      return_list: bool = False,
  ) -> Union[
      pd.Series,
      pd.DataFrame,
      List[Union[Tuple[pd.Timestamp, pd.Timestamp], pd.Timestamp]],
      Dict[
          str,
          List[Union[Tuple[pd.Timestamp, pd.Timestamp], pd.Timestamp]],
      ],
  ]:
      """Detect anomalies from given time series.
  
      Parameters
      ----------
      ts: pandas.Series or pandas.DataFrame
          Time series to detect anomalies from. If a DataFrame with k
          columns, it is treated as k independent univariate time series, and
          the detector will be applied to each univariate series
          independently.
  
      return_list: bool, optional
          Whether to return a list of anomalous events, or a binary series
          indicating normal/anomalous. Default: False.
  
      Returns
      -------
      pandas.Series, pandas.DataFrame, list, or dict
          Detected anomalies.
  
          - If input is a Series and return_list=False, return a Series;
          - If input is a DataFrame and return_list=False, return a
            DataFrame, where each column corresponds a column in input;
          - If input is a Series and return_list=True, return a list of time
            stamps or time stamp tuples;
          - If input is a DataFrame and return_list=True, return a dict of
            lists, where each key-value pair corresponds a column in input.
  
      """
      detected = self._predict(ts)
      if return_list:
          return to_events(detected)
      else:
          return detected
  
imports: from typing import Any, Callable, Dict, List, Tuple, Union
  import pandas
  from ._base import _NonTrainableUnivariateModel, _TrainableMultivariateModel, _TrainableUnivariateModel
  from .data import to_events
  from .metrics import f1_score, iou, precision, recall
label_desc: Use image node_id 1 for calling the _NonTrainableUnivariateDetector obj's underlying member method code with example usage: obj.predict(ts, return_list) and returns: to_events, detected