def fit(self, series: Union[TimeSeries, Sequence[TimeSeries]]) -> Self:
        """Trains the detector on the given time series.

        Parameters
        ----------
        series
            Time (sequence of) series to be used to train the detector.

        Returns
        -------
        self
            Fitted Detector.
        """
        width = series2seq(series)[0].width
        series = _check_input(
            series,
            name="series",
            width_expected=width,
            check_deterministic=True,
            check_binary=False,
            check_multivariate=False,
        )
        self.width_trained_on = width
        self._fit_core(series)
        self._fit_called = True
        return self
Trains the detector on the given time series.

        Parameters
        ----------
        series
            Time (sequence of) series to be used to train the detector.

        Returns
        -------
        self
            Fitted Detector.
        
darts/ad/detectors/detectors.py