def test_component_specific_lags_forecasts(self, config):
        """Verify that the same lags, defined using int/list or dictionaries yield the same results,
        including output_chunk_shift."""
        (list_lags, dict_lags), output_chunk_shift, multiple_series = config
        max_forecast = 3
        series, past_cov, future_cov = self.helper_generate_input_series_from_lags(
            list_lags,
            dict_lags,
            multiple_series,
            output_chunk_shift,
            max_forecast,
        )

        model = LinearRegressionModel(
            **list_lags, output_chunk_shift=output_chunk_shift
        )
        model.fit(
            series=series,
            past_covariates=past_cov,
            future_covariates=future_cov,
        )

        # the lags are specified for each component, individually
        model2 = LinearRegressionModel(
            **dict_lags, output_chunk_shift=output_chunk_shift
        )
        model2.fit(
            series=series,
            past_covariates=past_cov,
            future_covariates=future_cov,
        )

        if "lags_future_covariates" in list_lags:
            assert model.lags["future"] == [
                lag_ + output_chunk_shift
                for lag_ in list_lags["lags_future_covariates"]
            ]

            if "default_lags" in dict_lags["lags_future_covariates"]:
                # check that default lags
                default_components = (
                    model2.component_lags["future"].keys()
                    - dict_lags["lags_future_covariates"].keys()
                )
            else:
                default_components = dict()

            lags_specific = {
                comp_: (
                    dict_lags["lags_future_covariates"]["default_lags"]
                    if comp_ in default_components
                    else dict_lags["lags_future_covariates"][comp_]
                )
                for comp_ in model2.component_lags["future"]
            }
            assert model2.component_lags["future"] == {
                comp_: [lag_ + output_chunk_shift for lag_ in lags_]
                for comp_, lags_ in lags_specific.items()
            }

        # n == output_chunk_length
        s_ = series[0] if multiple_series else series
        pred_start_expected = s_.end_time() + (1 + output_chunk_shift) * s_.freq
        pred = model.predict(
            1,
            series=s_,
            past_covariates=(
                past_cov[0]
                if multiple_series and model.supports_past_covariates
                else None
            ),
            future_covariates=(
                future_cov[0]
                if multiple_series and model.supports_future_covariates
                else None
            ),
        )
        assert pred.start_time() == pred_start_expected
        pred2 = model2.predict(
            1,
            series=s_,
            past_covariates=(
                past_cov[0]
                if multiple_series and model2.supports_past_covariates
                else None
            ),
            future_covariates=(
                future_cov[0]
                if multiple_series and model2.supports_future_covariates
                else None
            ),
        )
        assert pred2.start_time() == pred_start_expected
        np.testing.assert_array_almost_equal(pred.values(), pred2.values())
        assert pred.time_index.equals(pred2.time_index)

        # auto-regression not supported for shifted output (tested in `test_output_shift`)
        if output_chunk_shift:
            return

        # n > output_chunk_length
        pred = model.predict(
            max_forecast,
            series=series[0] if multiple_series else None,
            past_covariates=(
                past_cov[0]
                if multiple_series and model.supports_past_covariates
                else None
            ),
            future_covariates=(
                future_cov[0]
                if multiple_series and model.supports_future_covariates
                else None
            ),
        )
        pred2 = model2.predict(
            max_forecast,
            series=series[0] if multiple_series else None,
            past_covariates=(
                past_cov[0]
                if multiple_series and model2.supports_past_covariates
                else None
            ),
            future_covariates=(
                future_cov[0]
                if multiple_series and model2.supports_future_covariates
                else None
            ),
        )
        np.testing.assert_array_almost_equal(pred.values(), pred2.values())
        assert pred.time_index.equals(pred2.time_index)
Verify that the same lags, defined using int/list or dictionaries yield the same results,
        including output_chunk_shift.
darts/tests/models/forecasting/test_sklearn_models.py