def detect(
        self,
        series: Union[TimeSeries, Sequence[TimeSeries]],
        name: str = "series",
    ) -> Union[TimeSeries, Sequence[TimeSeries]]:
        """Detect anomalies on given time series.

        Parameters
        ----------
        series
            The (sequence of) series on which to detect anomalies.
        name
            The name of `series`.

        Returns
        -------
        Union[TimeSeries, Sequence[TimeSeries]]
            binary prediction (1 if considered as an anomaly, 0 if not)
        """
        called_with_single_series = isinstance(series, TimeSeries)
        series = _check_input(
            series,
            name=name,
            width_expected=self.width_trained_on,
            check_deterministic=True,
        )
        detected_series = []
        for s in series:
            detected_series.append(self._detect_core(s, name=name))
        return detected_series[0] if called_with_single_series else detected_series
Detect anomalies on given time series.

        Parameters
        ----------
        series
            The (sequence of) series on which to detect anomalies.
        name
            The name of `series`.

        Returns
        -------
        Union[TimeSeries, Sequence[TimeSeries]]
            binary prediction (1 if considered as an anomaly, 0 if not)
        
darts/ad/detectors/detectors.py