class_docstr: Base class for all detectors
class_docstr_tok: ["Base","class","for","all","detectors"]
docstr: Detect anomalies on given time series.
  
  Parameters
  ----------
  series
      series on which to detect anomalies.
  
  Returns
  -------
  Union[TimeSeries, Sequence[TimeSeries]]
      binary prediciton (1 if considered as an anomaly, 0 if not)
docstr_tok: ["Detect","anomalies","on","given","time","series",".","Parameters","--","--","--","--","--","series","series","on","which","to","detect","anomalies",".","Returns","--","--","--","-","Union","[","TimeSeries",",","Sequence","[","TimeSeries","]","]","binary","prediciton","(","1","if","considered","as","an","anomaly",",","0","if","not",")"]
code: def detect(
      self,
      series: Union[TimeSeries, Sequence[TimeSeries]],
  ) -> Union[TimeSeries, Sequence[TimeSeries]]:
      """Detect anomalies on given time series.
  
      Parameters
      ----------
      series
          series on which to detect anomalies.
  
      Returns
      -------
      Union[TimeSeries, Sequence[TimeSeries]]
          binary prediciton (1 if considered as an anomaly, 0 if not)
      """
  
      list_series = (
          [series] if not isinstance(series, Sequence) else series
      )
  
      raise_if_not(
          all([isinstance(s, TimeSeries) for s in list_series]),
          "all series in `series` must be of type TimeSeries.",
      )
  
      raise_if_not(
          all([s.is_deterministic for s in list_series]),
          "all series in `series` must be deterministic (number of samples equal to 1).",
      )
  
      detected_series = []
      for s in list_series:
          detected_series.append(self._detect_core(s))
  
      if len(detected_series) == 1 and not isinstance(series, Sequence):
          return detected_series[0]
      else:
          return detected_series
  
file_path: darts/darts/ad/detectors/detectors.py
imports: from abc import ABC, abstractmethod
  from typing import Any, Sequence, Union
  from darts import TimeSeries
  from darts.ad.utils import eval_accuracy_from_binary_prediction
  from darts.logging import raise_if_not
label_desc: Use image node_id 2 for calling the Detector obj's underlying member method code with example usage: obj.detect(series) and returns: detected_series, detected_series