code: def test_summary():
      dates = pd.date_range(
          start="1980-01-01", end="1984-01-01", freq="YS"
      )
      endog = pd.Series([1, 2, 3, 4, 5], index=dates)
      mod = MLEModel(endog, **kwargs)
      res = mod.filter([])
  
      # Get the summary
      txt = str(res.summary())
  
      # Test res.summary when the model has dates
      assert_equal(
          re.search(r"Sample:\s+01-01-1980", txt) is not None, True
      )
      assert_equal(re.search(r"\s+- 01-01-1984", txt) is not None, True)
  
      # Test res.summary when `model_name` was not provided
      assert_equal(
          re.search(r"Model:\s+MLEModel", txt) is not None, True
      )
  
      # Smoke test that summary still works when diagnostic tests fail
      with warnings.catch_warnings():
          warnings.simplefilter("ignore")
          res.filter_results._standardized_forecasts_error[:] = np.nan
          res.summary()
          res.filter_results._standardized_forecasts_error = 1
          res.summary()
          res.filter_results._standardized_forecasts_error = "a"
          res.summary()
  
imports: from statsmodels.compat.pandas import MONTH_END
  import os
  import re
  import warnings
  import numpy
  from numpy.testing import assert_, assert_allclose, assert_almost_equal, assert_equal, assert_raises
  import pandas
  import pytest
  from statsmodels.datasets import nile
  from statsmodels.tsa.statespace import kalman_filter, kalman_smoother, sarimax, varmax
  from statsmodels.tsa.statespace.mlemodel import MLEModel, MLEResultsWrapper
  from statsmodels.tsa.statespace.tests.results import results_sarimax, results_var_misc
label_desc: Use image node_id 17 for calling a global function with example usage: test_summary() without return types