def fit(
        self,
        series: Union[TimeSeries, Sequence[TimeSeries]],
        allow_model_training: bool,
        **kwargs,
    ) -> Self:
        """Fit the underlying forecasting/filtering model (if applicable) and the fittable scorers."""
        # interrupt training if nothing to fit
        if not allow_model_training and not self.scorers_are_trainable:
            return self

        # check input series and covert to sequences
        series, kwargs = self._process_input_series(series, **kwargs)
        self._fit_core(
            series=series, allow_model_training=allow_model_training, **kwargs
        )
        return self
Fit the underlying forecasting/filtering model (if applicable) and the fittable scorers.
darts/ad/anomaly_model/anomaly_model.py