code: def test_fit_predict(daily_data, monthly_data):
      """Tests fit and predict."""
      for data in daily_data, monthly_data:
          model = AutoArimaEstimator()
          train_df = daily_data["train_df"]
          test_df = daily_data["test_df"]
          assert model.last_predicted_X_ is None
          assert model.cached_predictions_ is None
  
          model.fit(train_df, time_col=TIME_COL, value_col=VALUE_COL)
          assert model.last_predicted_X_ is None
          assert model.cached_predictions_ is None
          with LogCapture(LOGGER_NAME) as log_capture:
              predicted = model.predict(test_df)
              assert list(predicted.columns) == [
                  TIME_COL,
                  PREDICTED_COL,
                  PREDICTED_LOWER_COL,
                  PREDICTED_UPPER_COL,
              ]
              assert_equal(model.last_predicted_X_, test_df)
              assert_equal(model.cached_predictions_, predicted)
              log_capture.check()  # no log messages (not using cached predictions)
  
          y_true = test_df[VALUE_COL]
          y_pred = predicted[PREDICTED_COL]
  
          err = calc_pred_err(y_true, y_pred)
          enum = EvaluationMetricEnum.Correlation
          assert err[enum.get_metric_name()] > 0.50
          enum = EvaluationMetricEnum.MeanAbsoluteError
          assert err[enum.get_metric_name()] < 10.0
          enum = EvaluationMetricEnum.RootMeanSquaredError
          assert err[enum.get_metric_name()] < 10.0
          enum = EvaluationMetricEnum.MedianAbsoluteError
          assert err[enum.get_metric_name()] < 10.0
  
          # Uses cached predictions
          with LogCapture(LOGGER_NAME) as log_capture:
              assert_equal(model.predict(test_df), predicted)
              log_capture.check(
                  (
                      LOGGER_NAME,
                      LoggingLevelEnum.DEBUG.name,
                      "Returning cached predictions.",
                  )
              )
  
          # Predicts on a different dataset
          with LogCapture(LOGGER_NAME) as log_capture:
              predicted = model.predict(train_df)
              assert_equal(model.last_predicted_X_, train_df)
              assert_equal(model.cached_predictions_, predicted)
              log_capture.check()  # no log messages (not using cached predictions)
  
          # .fit() clears the cached result
          model.fit(train_df, time_col=TIME_COL, value_col=VALUE_COL)
          assert model.last_predicted_X_ is None
          assert model.cached_predictions_ is None
  
imports: import numpy
  import pandas
  import pytest
  from pmdarima.arima import AutoARIMA
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_squared_error
  from testfixtures import LogCapture
  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.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.evaluation import calc_pred_err
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.sklearn.estimator.auto_arima_estimator import AutoArimaEstimator
label_desc: Use image node_id 9 for calling a global function with example usage: test_fit_predict(daily_data, monthly_data) without return types