code: def test_agg_func(df_daily):
      """Tests different aggregation functions."""
      df_train = df_daily["df_train"]
      df_test = df_daily["df_test"]
  
      # wo3w median
      model = LagBasedEstimator(
          lag_unit="week", lags=[1, 2, 3], agg_func="median"
      )
      model.fit(df_train)
      # 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 median of the past three weeks.
      assert (
          df_fit[PREDICTED_COL]
          .iloc[-5:]
          .reset_index(drop=True)
          .equals(df_fit["y"].iloc[-19:-14].reset_index(drop=True))
      )
      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 median of the past three weeks.
      assert (
          df_pred[PREDICTED_COL]
          .iloc[:7]
          .reset_index(drop=True)
          .equals(df_fit["y"].iloc[-14:-7].reset_index(drop=True))
      )
      # The future predictions use the predicted values.
      assert (
          df_pred[PREDICTED_COL]
          .iloc[7:14]
          .reset_index(drop=True)
          .equals(
              df_pred[PREDICTED_COL].iloc[-7:].reset_index(drop=True)
          )
      )
  
      # wo3w minimum
      model = LagBasedEstimator(
          lag_unit="week", lags=[1, 2, 3], agg_func="minimum"
      )
      model.fit(df_train)
      # 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 minimum of the past three weeks.
      assert (
          df_fit[PREDICTED_COL]
          .iloc[-5:]
          .reset_index(drop=True)
          .equals(df_fit["y"].iloc[-26:-21].reset_index(drop=True))
      )
      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 minimum of the past three weeks.
      assert (
          df_pred[PREDICTED_COL]
          .iloc[:7]
          .reset_index(drop=True)
          .equals(df_fit["y"].iloc[-21:-14].reset_index(drop=True))
      )
      # The future predictions use the predicted values.
      assert (
          df_pred[PREDICTED_COL]
          .iloc[7:14]
          .reset_index(drop=True)
          .equals(
              df_pred[PREDICTED_COL].iloc[-7:].reset_index(drop=True)
          )
      )
  
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 12 for calling a global function with example usage: test_agg_func(df_daily) without return types