code: def create_lagged_prediction_data(
      target_series: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
      past_covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
      future_covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
      lags: Optional[Union[Sequence[int], Dict[str, List[int]]]] = None,
      lags_past_covariates: Optional[
          Union[Sequence[int], Dict[str, List[int]]]
      ] = None,
      lags_future_covariates: Optional[
          Union[Sequence[int], Dict[str, List[int]]]
      ] = None,
      uses_static_covariates: bool = True,
      last_static_covariates_shape: Optional[Tuple[int, int]] = None,
      max_samples_per_ts: Optional[int] = None,
      check_inputs: bool = True,
      use_moving_windows: bool = True,
      concatenate: bool = True,
  ) -> Tuple[ArrayOrArraySequence, Sequence[pd.Index]]:
      """
      Creates the features array `X` to produce a series of prediction from an already-trained regression model; the
      time index values of each observation is also returned.
  
      Notes
      -----
      This function is simply a wrapper around `create_lagged_data`; for further details on the structure of `X`, please
      refer to `help(create_lagged_data)`.
  
      Parameters
      ----------
      target_series
          Optionally, the series for the regression model to predict.
      past_covariates
          Optionally, the past covariates series that the regression model will use as inputs. Unlike the
          `target_series`, `past_covariates` are *not* to be predicted by the regression model.
      future_covariates
          Optionally, the future covariates (i.e. exogenous covariates) series that the regression model will
          use as inputs.
      lags
          Optionally, the lags of the target series to be used as (auto-regressive) features. If not specified,
          auto-regressive features will *not* be added to `X`. Each lag value is assumed to be negative (e.g.
          `lags = [-3, -1]` will extract `target_series` values which are 3 timesteps and 1 timestep away from
          the current value). If the lags are provided as a dictionary, the lags values are specific to each
          component in the target series.
      lags_past_covariates
          Optionally, the lags of `past_covariates` to be used as features. Like `lags`, each lag value is assumed to
          be less than or equal to -1. If the lags are provided as a dictionary, the lags values are specific to each
          component in the past covariates series.
      lags_future_covariates
          Optionally, the lags of `future_covariates` to be used as features. Unlike `lags` and `lags_past_covariates`,
          `lags_future_covariates` values can be positive (i.e. use values *after* time `t` to predict target at
          time `t`), zero (i.e. use values *at* time `t` to predict target at time `t`), and/or negative (i.e. use
          values *before* time `t` to predict target at time `t`). If the lags are provided as a dictionary, the lags
          values are specific to each component in the future covariates series.
      uses_static_covariates
          Whether the model uses/expects static covariates. If `True`, it enforces that static covariates must
          have identical shapes across all target series.
      last_static_covariates_shape
          Optionally, the last observed shape of the static covariates. This is ``None`` before fitting, or when
          `uses_static_covariates` is ``False``.
      max_samples_per_ts
          Optionally, the maximum number of samples to be drawn for training/validation; only the most recent
          samples are kept. In theory, specifying a smaller `max_samples_per_ts` should reduce computation time,
          especially in cases where many observations could be generated.
      check_inputs
          Optionally, specifies that the `lags_*` and `series_*` inputs should be checked for validity. Should be set
          to `False` if inputs have already been checked for validity (e.g. inside the `__init__` of a class), otherwise
          should be set to `True`.
      use_moving_windows
          Optionally, specifies that the 'moving window' method should be used to construct `X` and `y` if all of the
          provided series are of the same frequency. If `use_moving_windows = False`, the 'time intersection' method
          will always be used, even when all of the provided series are of the same frequency. In general, setting
          to `True` results in faster tabularization at the potential cost of higher memory usage. See Notes for further
          details.
      concatenate
          Optionally, specifies that `X` should be returned as a single `np.ndarray`, instead of as a
          `Sequence[np.ndarray]`. If each series input is specified as a `Sequence[TimeSeries]` and `concatenate = False`,
          `X` will be a list whose `i`th element corresponds to the feature matrix or label array formed by the `i`th
          `TimeSeries` in each `Sequence[TimeSeries]` input. Conversely, if `concatenate = True` when
          `Sequence[TimeSeries]` are provided, then `X` will be an array created by concatenating all of the feature
          arrays formed by each `TimeSeries` along the `0`th axis. Note that `times` is still returned as
          `Sequence[pd.Index]`, even when `concatenate = True`.
  
      Returns
      -------
      X
          The constructed features array(s), with shape `(n_observations, n_lagged_features, n_samples)`.
          If the series inputs were specified as `Sequence[TimeSeries]` and `concatenate = False`, then `X`
          is returned as a `Sequence[np.array]`; otherwise, `X` is returned as a single `np.array`.
      times
          The `time_index` of each observation in `X` and `y`, returned as a `Sequence` of `pd.Index`es.
          If the series inputs were specified as `Sequence[TimeSeries]`, then the `i`th list element
          gives the times of those observations formed using the `i`th `TimeSeries` object in each
          `Sequence`. Otherwise, if the series inputs were specified as `TimeSeries`, the only
          element is the times of those observations formed from the lone `TimeSeries` inputs.
  
      Raises
      ------
      ValueError
          If the specified time series do not share any times for which features can be constructed.
      ValueError
          If no lags are specified, or if any of the specified lag values are non-negative.
      ValueError
          If any of the series are too short to create features for the requested lag values.
      ValueError
          If the provided series do not share the same type of `time_index` (e.g. `target_series` uses a
          pd.RangeIndex, but `future_covariates` uses a `pd.DatetimeIndex`).
      """
      X, _, times, _ = create_lagged_data(
          target_series=target_series,
          past_covariates=past_covariates,
          future_covariates=future_covariates,
          lags=lags,
          lags_past_covariates=lags_past_covariates,
          lags_future_covariates=lags_future_covariates,
          uses_static_covariates=uses_static_covariates,
          last_static_covariates_shape=last_static_covariates_shape,
          max_samples_per_ts=max_samples_per_ts,
          check_inputs=check_inputs,
          use_moving_windows=use_moving_windows,
          is_training=False,
          concatenate=concatenate,
      )
      return X, times
  
imports: import warnings
  from functools import reduce
  from math import inf
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  from itertools import chain
  import numpy
  import pandas
  from numpy.lib.stride_tricks import as_strided
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from darts.timeseries import TimeSeries
  from darts.utils.utils import get_single_series, series2seq
label_desc: Use image node_id 3 for calling a global function with example usage: create_lagged_prediction_data(target_series, past_covariates, future_covariates, lags, lags_past_covariates, lags_future_covariates, uses_static_covariates, last_static_covariates_shape, max_samples_per_ts, check_inputs, use_moving_windows, concatenate) and returns: X,  times