def helper_create_expected_lagged_data(
        self,
        target: Optional[Union[TimeSeries, list[TimeSeries]]],
        past: Optional[Union[TimeSeries, list[TimeSeries]]],
        future: Optional[Union[TimeSeries, list[TimeSeries]]],
        lags: Optional[Union[list[int], dict[str, list[int]]]],
        lags_past: Optional[Union[list[int], dict[str, list[int]]]],
        lags_future: Optional[Union[list[int], dict[str, list[int]]]],
        output_chunk_length: int,
        output_chunk_shift: int,
        multi_models: bool,
        max_samples_per_ts: Optional[int],
        stride: int,
    ) -> tuple[np.ndarray, np.ndarray, Any]:
        """Helper function to create the X and y arrays by building them block by block (one per covariates)."""
        feats_times = self.get_feature_times(
            target,
            past,
            future,
            lags,
            lags_past,
            lags_future,
            output_chunk_length,
            max_samples_per_ts,
            output_chunk_shift,
            stride,
        )
        # Construct `X` by constructing each block, then concatenate these
        # blocks together along component axis:
        X_target = self.construct_X_block(target, feats_times, lags)
        X_past = self.construct_X_block(past, feats_times, lags_past)
        X_future = self.construct_X_block(future, feats_times, lags_future)
        all_X = (X_target, X_past, X_future)
        to_concat = [X for X in all_X if X is not None]
        expected_X = np.concatenate(to_concat, axis=1)
        expected_y = self.create_y(
            target,
            feats_times,
            output_chunk_length,
            multi_models,
            output_chunk_shift,
        )
        if len(expected_X.shape) == 2:
            expected_X = expected_X[:, :, np.newaxis]
        if len(expected_y.shape) == 2:
            expected_y = expected_y[:, :, np.newaxis]
        return expected_X, expected_y, feats_times
Helper function to create the X and y arrays by building them block by block (one per covariates).
darts/tests/utils/tabularization/test_create_lagged_training_data.py