code: def test_filter_train_X_y_for_step_output_when_lags_3_steps_2_and_exog_for_step_2():
      """
      Test output of filter_train_X_y_for_step when regressor is LinearRegression,
      lags is 3 and steps is 2 with exog for step 2.
      """
      series = pd.DataFrame(
          {
              "l1": pd.Series(np.arange(10), dtype=float),
              "l2": pd.Series(np.arange(50, 60), dtype=float),
          }
      )
      exog = pd.Series(np.arange(100, 110), name="exog", dtype=int)
  
      forecaster = ForecasterAutoregMultiVariate(
          LinearRegression(),
          level="l2",
          lags=[1, 2, 3],
          steps=2,
          transformer_series=None,
      )
      X_train, y_train = forecaster.create_train_X_y(
          series=series, exog=exog
      )
      results = forecaster.filter_train_X_y_for_step(
          step=2, X_train=X_train, y_train=y_train
      )
  
      expected = (
          pd.DataFrame(
              data=np.array(
                  [
                      [2.0, 1.0, 0.0, 52.0, 51.0, 50.0, 104.0],
                      [3.0, 2.0, 1.0, 53.0, 52.0, 51.0, 105.0],
                      [4.0, 3.0, 2.0, 54.0, 53.0, 52.0, 106.0],
                      [5.0, 4.0, 3.0, 55.0, 54.0, 53.0, 107.0],
                      [6.0, 5.0, 4.0, 56.0, 55.0, 54.0, 108.0],
                      [7.0, 6.0, 5.0, 57.0, 56.0, 55.0, 109.0],
                  ],
                  dtype=float,
              ),
              index=pd.RangeIndex(start=4, stop=10, step=1),
              columns=[
                  "l1_lag_1",
                  "l1_lag_2",
                  "l1_lag_3",
                  "l2_lag_1",
                  "l2_lag_2",
                  "l2_lag_3",
                  "exog_step_2",
              ],
          ).astype({"exog_step_2": int}),
          pd.Series(
              data=np.array([54.0, 55.0, 56.0, 57.0, 58.0, 59.0]),
              index=pd.RangeIndex(start=4, stop=10, step=1),
              name="l2_step_2",
              dtype=float,
          ),
      )
  
      pd.testing.assert_frame_equal(results[0], expected[0])
      pd.testing.assert_series_equal(results[1], expected[1])
  
file_path: skforecast/skforecast/ForecasterAutoregMultiVariate/tests/test_filter_train_X_y_for_step.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregMultiVariate import ForecasterAutoregMultiVariate
  from sklearn.linear_model import LinearRegression
label_desc: Use image node_id 3 for calling a global function with example usage: test_filter_train_X_y_for_step_output_when_lags_3_steps_2_and_exog_for_step_2() without return types