code: def test_monthly_data(df_monthly):
      """Tests functionality on monthly data."""
      df_train = df_monthly["df_train"]
      df_test = df_monthly["df_test"]
  
      model = LagBasedEstimator(
          lag_unit="month",
          lags=[2, 3],
          series_na_fill_func=lambda s: s.bfill().ffill(),
      )
      model.fit(df_train)
      # Checks ``model.df``.
      # It should include the past 3 months data interpolated.
      # The interpolated values are zero with the default function.
      df_expanded = pd.concat(
          [
              pd.DataFrame(
                  {
                      "ts": pd.date_range(
                          start=df_train["ts"].iloc[0]
                          - relativedelta(months=3),
                          periods=3,
                          freq="MS",
                      ),
                      "y": 0.0,
                  }
              ),
              df_train,
          ],
          axis=0,
      ).reset_index(drop=True)
      assert model.df.equals(df_expanded)
      assert model.uncertainty_model is None
      assert model.max_lag_order == 3
      assert model.min_lag_order == 2
      assert model.train_start == df_train["ts"].iloc[0]
      assert model.train_end == df_train["ts"].iloc[-1]
  
      # Checks prediction within training.
      df_fit = model.predict(df_train)
      # The value column should be the same as the input.
      assert df_fit["y"].equals(df_train["y"].astype(float))
      # The predicted column is the average of the last 2 and 3 months.
      assert (
          df_fit[PREDICTED_COL]
          .iloc[-5:]
          .reset_index(drop=True)
          .equals(
              (
                  df_fit["y"].iloc[-8:-3].reset_index(drop=True)
                  + df_fit["y"].iloc[-7:-2].reset_index(drop=True)
              )
              / 2
          )
      )
      assert list(df_fit.columns) == ["ts", "y", PREDICTED_COL]
  
      # Checks prediction in the future.
      df_pred = model.predict(df_test)
      # The value column should be NANs.
      assert all(df_pred["y"].isna())
      # The predicted column is the average of the last 2 and 3 months.
      assert (
          df_pred[PREDICTED_COL]
          .iloc[:2]
          .reset_index(drop=True)
          .equals(
              (
                  df_fit["y"].iloc[-2:].reset_index(drop=True)
                  + df_fit["y"].iloc[-3:-1].reset_index(drop=True)
              )
              / 2
          )
      )
      # The future predictions use the predicted values.
      assert (
          df_pred[PREDICTED_COL]
          .iloc[3:5]
          .reset_index(drop=True)
          .equals(
              (
                  df_pred[PREDICTED_COL].iloc[:2].reset_index(drop=True)
                  + df_pred[PREDICTED_COL]
                  .iloc[1:3]
                  .reset_index(drop=True)
              )
              / 2
          )
      )
  
imports: from datetime import timedelta
  import numpy
  import pandas
  import pytest
  from dateutil.relativedelta import relativedelta
  from testfixtures import LogCapture
  from greykite.common.constants import ERR_STD_COL
  from greykite.common.constants import LOGGER_NAME
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.sklearn.estimator.lag_based_estimator import LagBasedEstimator
label_desc: Use image node_id 13 for calling a global function with example usage: test_monthly_data(df_monthly) without return types