code: def test_build_autoreg_df_pass_past_df():
      """Testing build_autoreg_df with
      past_df being passed at predict time
      """
      df = pd.DataFrame(
          {
              "x": [
                  1.0,
                  5.0,
                  6.0,
                  7.0,
                  8.0,
                  -1.0,
                  -10.0,
                  -19.0,
                  -20.0,
                  10.0,
              ],
              "y": range(10),
          }
      )
  
      past_df = pd.DataFrame(
          {
              "x": [
                  4.0,
                  5.0,
                  6.0,
                  7.0,
                  8.0,
                  -1.0,
                  -10.0,
                  -11.0,
                  -10.0,
                  15.0,
              ],
              "y": range(10),
          }
      )
  
      autoreg_info = build_autoreg_df(
          value_col="x",
          lag_dict={"orders": [1, 2, 5]},
          agg_lag_dict={
              "orders_list": [[1, 2, 5], [1, 3, 8], [2, 3, 4]],
              "interval_list": [(1, 5), (1, 8)],
          },
          series_na_fill_func=None,
      )  # no filling of NAs
  
      build_lags_func = autoreg_info["build_lags_func"]
  
      # the following line should run without issues (no exceptions)
      lag_df_info = build_lags_func(df=df, past_df=past_df)
      lag_df = lag_df_info["lag_df"]
      agg_lag_df = lag_df_info["agg_lag_df"]
  
      assert list(lag_df.columns) == [
          "x_lag1",
          "x_lag2",
          "x_lag5",
      ], "The expected column names were not found in lags dataframe (lag_df)"
      assert list(agg_lag_df.columns) == [
          "x_avglag_1_2_5",
          "x_avglag_1_3_8",
          "x_avglag_2_3_4",
          "x_avglag_1_to_5",
          "x_avglag_1_to_8",
      ], "aggregated lag df does not have the correct names"
      assert (
          lag_df["x_lag1"].values[0].round(0) == 15.0
      ), "lag value is not correct"
      assert (
          agg_lag_df["x_avglag_1_to_8"].values[7].round(1) == 3.9
      ), "aggregated lags are not correct"
  
imports: import numpy
  import pandas
  import pytest
  from greykite.common.features.timeseries_lags import build_agg_lag_df
  from greykite.common.features.timeseries_lags import build_autoreg_df
  from greykite.common.features.timeseries_lags import build_autoreg_df_multi
  from greykite.common.features.timeseries_lags import build_lag_df
  from greykite.common.features.timeseries_lags import min_max_lag_order
  from greykite.common.python_utils import assert_equal
label_desc: Use image node_id 10 for calling a global function with example usage: test_build_autoreg_df_pass_past_df() without return types