code: def test_comparison_types():
      endog = dta["infl"].copy()
      endog.iloc[-1] = np.nan
      msg = "Could not automatically determine the type of comparison"
  
      mod = sarimax.SARIMAX(endog)
      res = mod.smooth([0.5, 1.0])
  
      # Test that the comparison type cannot be determined if the given dataset
      # or results dataset is identical to the previous dataset
      with pytest.raises(ValueError, match=msg):
          res.news(endog)
      with pytest.raises(ValueError, match=msg):
          res.news(res)
  
      # Test that if the the comparison type is specified, the news can be
      # computed from data that has the same shape and number of NaNs (this can
      # happen if there are only revisions but no updates)
      news = res.news(endog, comparison_type="previous")
      assert_allclose(news.total_impacts, 0)
      news = res.news(endog, comparison_type="updated")
      assert_allclose(news.total_impacts, 0)
      news = res.news(res, comparison_type="updated")
      assert_allclose(news.total_impacts, 0)
      news = res.news(res, comparison_type="updated")
      assert_allclose(news.total_impacts, 0)
  
imports: from statsmodels.compat.pandas import FUTURE_STACK, assert_frame_equal, assert_series_equal
  import numpy
  from numpy.testing import assert_, assert_allclose, assert_equal
  import pandas
  import pytest
  from statsmodels import datasets
  from statsmodels.tsa.statespace import dynamic_factor, sarimax, structural, varmax
label_desc: Use image node_id 13 for calling a global function with example usage: test_comparison_types() without return types