code: def test_log_message(df_daily):
      """Tests log messages."""
      df_train = df_daily["df_train"]
      df_test = df_daily["df_test"]
      # Lag not provided, using default 1.
      # Weights not provided, using default equal weights.
      with LogCapture(LOGGER_NAME) as log_capture:
          model = LagBasedEstimator()
          model.fit(df_train)
          assert (
              LOGGER_NAME,
              "DEBUG",
              "Lags not provided, setting lags = [1].",
          ) in log_capture.actual()
  
      # Inferred frequency is different.
      with LogCapture(LOGGER_NAME) as log_capture:
          model = LagBasedEstimator(freq="H")
          model.fit(df_train)
          assert (
              LOGGER_NAME,
              "INFO",
              f"The inferred frequency 'D' is different from the provided 'H'. "
              f"Using the provided frequency.",
          ) in log_capture.actual()
      # Prediction has irregular time increments.
      with LogCapture(LOGGER_NAME) as log_capture:
          model = LagBasedEstimator()
          model.fit(df_train)
          df_test_with_irregular = pd.concat(
              [
                  df_test,
                  pd.DataFrame(
                      {
                          "ts": [
                              df_test["ts"].iloc[0] + timedelta(hours=6)
                          ],
                          "y": [np.nan],
                      }
                  ),
              ]
          )
          model.predict(df_test_with_irregular)
          assert (
              LOGGER_NAME,
              "WARNING",
              f"Some timestamps in the provided time periods for prediction do not match the "
              f"training frequency. Returning the matched timestamps.",
          ) in log_capture.actual()
      # Warning on frequency "M".
      with LogCapture(LOGGER_NAME) as log_capture:
          df_month = pd.DataFrame(
              {
                  "ts": pd.date_range(
                      "2020-01-31", freq="M", periods=10
                  ),
                  "y": list(range(10)),
              }
          )
          model = LagBasedEstimator(lag_unit="month")
          model.fit(df_month)
          assert (
              LOGGER_NAME,
              "WARNING",
              "The data frequency is 'M' which may lead to unexpected behaviors. "
              "Please convert to 'MS' if applicable.",
          ) in log_capture.actual()
  
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 15 for calling a global function with example usage: test_log_message(df_daily) without return types