def __init__(
        self,
        model: ForecastingModel,
        background_series: Optional[Union[TimeSeries, Sequence[TimeSeries]]] = None,
        background_past_covariates: Optional[
            Union[TimeSeries, Sequence[TimeSeries]]
        ] = None,
        background_future_covariates: Optional[
            Union[TimeSeries, Sequence[TimeSeries]]
        ] = None,
        requires_background: bool = False,
        requires_covariates_encoding: bool = False,
        check_component_names: bool = False,
        test_stationarity: bool = False,
    ):
        """
        The base class for forecasting model explainers. It defines the *minimal* behavior that all
        forecasting model explainers support.

        Naming:

        - A background series is a `TimeSeries` with which to 'train' the `Explainer` model.
        - A foreground series is the `TimeSeries` to explain using the fitted `Explainer` model.

        Parameters
        ----------
        model
            A `ForecastingModel` to be explained. It must be fitted first.
        background_series
            A series or list of series to *train* the `_ForecastingModelExplainer` along with any foreground series.
            Consider using a reduced well-chosen background to reduce computation time.
            Optional if `model` was fit on a single target series. By default, it is the `series` used at fitting time.
            Mandatory if `model` was fit on multiple (sequence of) target series.
        background_past_covariates
            A past covariates series or list of series that the model needs once fitted.
        background_future_covariates
            A future covariates series or list of series that the model needs once fitted.
        requires_background
            Whether the explainer requires background series as an input. If `True`, raises an error if no background
            series were provided and `model` was fit using multiple series.
        requires_covariates_encoding
            Whether to apply the model's encoders to the input covariates. This should only be `True` if the
            Explainer will not call model methods `fit()` or `predict()` directly.
        check_component_names
            Whether to enforce that, in the case of multiple time series, all series of the same type (target and/or
            *_covariates) must have the same component names.
        test_stationarity
            Whether to raise a warning if not all `background_series` are stationary.
        """
        if not model._fit_called:
            raise_log(
                ValueError(
                    f"The model must be fitted before instantiating a {self.__class__.__name__}."
                ),
                logger,
            )
        self.model = model
        # default forecasting horizon
        self.n: Optional[int] = getattr(self.model, "output_chunk_length", None)

        # check background input validity and process it
        (
            self.background_series,
            self.background_past_covariates,
            self.background_future_covariates,
            self.target_components,
            self.static_covariates_components,
            self.past_covariates_components,
            self.future_covariates_components,
        ) = process_input(
            model=model,
            input_type="background",
            series=background_series,
            past_covariates=background_past_covariates,
            future_covariates=background_future_covariates,
            fallback_series=model.training_series,
            fallback_past_covariates=model.past_covariate_series,
            fallback_future_covariates=model.future_covariate_series,
            check_component_names=check_component_names,
            requires_input=requires_background,
            requires_covariates_encoding=requires_covariates_encoding,
            test_stationarity=test_stationarity,
        )
        self.requires_foreground = self.background_series is None
        self.requires_covariates_encoding = requires_covariates_encoding
        self.check_component_names = check_component_names
        self.test_stationarity = test_stationarity

        The base class for forecasting model explainers. It defines the *minimal* behavior that all
        forecasting model explainers support.

        Naming:

        - A background series is a `TimeSeries` with which to 'train' the `Explainer` model.
        - A foreground series is the `TimeSeries` to explain using the fitted `Explainer` model.

        Parameters
        ----------
        model
            A `ForecastingModel` to be explained. It must be fitted first.
        background_series
            A series or list of series to *train* the `_ForecastingModelExplainer` along with any foreground series.
            Consider using a reduced well-chosen background to reduce computation time.
            Optional if `model` was fit on a single target series. By default, it is the `series` used at fitting time.
            Mandatory if `model` was fit on multiple (sequence of) target series.
        background_past_covariates
            A past covariates series or list of series that the model needs once fitted.
        background_future_covariates
            A future covariates series or list of series that the model needs once fitted.
        requires_background
            Whether the explainer requires background series as an input. If `True`, raises an error if no background
            series were provided and `model` was fit using multiple series.
        requires_covariates_encoding
            Whether to apply the model's encoders to the input covariates. This should only be `True` if the
            Explainer will not call model methods `fit()` or `predict()` directly.
        check_component_names
            Whether to enforce that, in the case of multiple time series, all series of the same type (target and/or
            *_covariates) must have the same component names.
        test_stationarity
            Whether to raise a warning if not all `background_series` are stationary.
        
darts/explainability/explainability.py