code: def test_defaults(revisions, updates):
      # Construct previous and updated datasets
      endog = dta["infl"].copy()
      if updates:
          endog1 = endog.loc[:"2009Q2"].copy()
          endog2 = endog.loc[:"2009Q3"].copy()
      else:
          endog1 = endog.loc[:"2009Q3"].copy()
          endog2 = endog.loc[:"2009Q3"].copy()
      if revisions:
          # TODO: add test for only one of the variables revising?
          endog1.iloc[-1] = 0.0
  
      # Get the previous results object and compute the news
      mod1 = sarimax.SARIMAX(endog1)
      res1 = mod1.smooth([0.5, 1.0])
  
      mod2 = sarimax.SARIMAX(endog2)
      res2 = mod2.smooth([0.5, 1.0])
  
      news_updated_data = res1.news(endog2, comparison_type="updated")
      news_previous_data = res2.news(endog1, comparison_type="previous")
      news_updated_results = res1.news(res2, comparison_type="updated")
      news_previous_results = res2.news(
          res1, comparison_type="previous"
      )
  
      attrs = [
          "total_impacts",
          "update_impacts",
          "revision_impacts",
          "news",
          "weights",
          "update_forecasts",
          "update_realized",
          "prev_impacted_forecasts",
          "post_impacted_forecasts",
          "revisions_iloc",
          "revisions_ix",
          "updates_iloc",
          "updates_ix",
      ]
  
      for attr in attrs:
          w = getattr(news_updated_data, attr)
          x = getattr(news_previous_data, attr)
          y = getattr(news_updated_results, attr)
          z = getattr(news_previous_results, attr)
          if isinstance(x, pd.Series):
              assert_series_equal(w, x)
              assert_series_equal(w, y)
              assert_series_equal(w, z)
          else:
              assert_frame_equal(w, x)
              assert_frame_equal(w, y)
              assert_frame_equal(w, z)
  
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 12 for calling a global function with example usage: test_defaults(revisions, updates) without return types