code: def test_sliding_window_transform_tabular(
      n_timepoints, window_length, n_variables, fh
  ):
      """Test sliding window transform tabular."""
      y, X = _make_y_X(
          n_timepoints=n_timepoints, n_variables=n_variables
      )
      fh = check_fh(fh, enforce_relative=True)
      fh_max = fh[-1]
      effective_window_length = window_length + fh_max - 1
  
      yt, Xt = _sliding_window_transform(
          y,
          window_length=window_length,
          fh=fh,
          X=X,
          scitype="tabular-regressor",
      )
      assert yt.shape == (
          n_timepoints - effective_window_length,
          len(fh),
      )
  
      # Check y values for first step in fh.
      actual = yt[:, 0]
      start = window_length + fh[0] - 1
      end = start + n_timepoints - window_length - fh_max + 1
      expected = y[np.arange(start, end)]
      np.testing.assert_array_equal(actual, expected)
  
      # The transformed Xt array contains lagged values for each variable, excluding the
      # n_variables + 1 contemporaneous values for the exogenous variables.
      # assert Xt.shape == (yt.shape[0], (window_length * n_variables) + n_variables - 1)
      assert Xt.shape == (yt.shape[0], window_length * n_variables)
      assert np.all(Xt < yt[:, [0]])
  
imports: import numpy
  import pandas
  import pytest
  from sklearn.base import BaseEstimator, RegressorMixin
  from sklearn.dummy import DummyRegressor
  from sklearn.linear_model import LinearRegression
  from sklearn.pipeline import make_pipeline
  from sktime.datasets import load_airline
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.forecasting.compose import DirectTabularRegressionForecaster, DirectTimeSeriesRegressionForecaster, DirRecTabularRegressionForecaster, DirRecTimeSeriesRegressionForecaster, MultioutputTabularRegressionForecaster, MultioutputTimeSeriesRegressionForecaster, RecursiveTabularRegressionForecaster, RecursiveTimeSeriesRegressionForecaster, make_reduction
  from sktime.forecasting.compose._reduce import _sliding_window_transform
  from sktime.forecasting.tests._config import TEST_OOS_FHS, TEST_WINDOW_LENGTHS_INT
  from sktime.performance_metrics.forecasting import mean_absolute_percentage_error
  from sktime.regression.base import BaseRegressor
  from sktime.regression.interval_based import TimeSeriesForestRegressor
  from sktime.split import SlidingWindowSplitter, temporal_train_test_split
  from sktime.split.tests.test_split import _get_windows
  from sktime.transformations.panel.reduce import Tabularizer
  from sktime.utils._testing.forecasting import make_forecasting_problem
  from sktime.utils.validation.forecasting import check_fh
label_desc: Use image node_id 3 for calling a global function with example usage: test_sliding_window_transform_tabular(n_timepoints, window_length, n_variables, fh) without return types