code: def test_error(params, hourly_data_with_reg):
      model = MultistageForecastEstimator(**params)
  
      # Calling plot components or summary before fitting.
      with pytest.raises(ValueError, match="Please call `fit` before"):
          model.plot_components()
  
      with pytest.raises(ValueError, match="Please call `fit` before"):
          model.summary()
  
      # Minimum aggregation frequency is less than data frequency.
      params["model_configs"][0].agg_freq = "5T"
      with pytest.raises(
          ValueError, match="The minimum aggregation frequency"
      ):
          model.fit(hourly_data_with_reg)
  
imports: import datetime
  import numpy
  import pandas
  import pytest
  from testfixtures import LogCapture
  import greykite.common.constants
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.sklearn.estimator.lag_based_estimator import LagBasedEstimator
  from greykite.sklearn.estimator.multistage_forecast_estimator import MultistageForecastEstimator
  from greykite.sklearn.estimator.multistage_forecast_estimator import MultistageForecastModelConfig
  from greykite.sklearn.estimator.simple_silverkite_estimator import SimpleSilverkiteEstimator
  from greykite.sklearn.uncertainty.uncertainty_methods import UncertaintyMethodEnum
label_desc: Use image node_id 19 for calling a global function with example usage: test_error(params, hourly_data_with_reg) without return types