code: def test_sarimax_time_invariant(
      revisions, updates, revisions_details_start
  ):
      # Construct previous and updated datasets
      endog = dta["infl"].copy()
      comparison_type = None
      if updates:
          endog1 = endog.loc[:"2009Q2"].copy()
          endog2 = endog.loc[:"2009Q3"].copy()
      else:
          endog1 = endog.loc[:"2009Q3"].copy()
          endog2 = endog.loc[:"2009Q3"].copy()
          # Without updates and without NaN values, we need to specify that
          # the type of the comparison object that we're passing is "updated"
          comparison_type = "updated"
      if revisions:
          endog1.iloc[-1] = 0.0
  
      # Get the previous results object and compute the news
      mod = sarimax.SARIMAX(endog1)
      res = mod.smooth([0.5, 1.0])
      news = res.news(
          endog2,
          start="2009Q2",
          end="2010Q1",
          comparison_type=comparison_type,
          revisions_details_start=revisions_details_start,
      )
  
      # Compute the true values for each combination of (revsions, updates)
      impact_dates = pd.period_range(
          start="2009Q2", end="2010Q1", freq="Q"
      )
      impacted_variables = ["infl"]
  
      # Revisions
      if revisions and updates:
          revisions_index = pd.MultiIndex.from_arrays(
              [endog1.index[-1:], ["infl"]],
              names=["revision date", "revised variable"],
          )
          # If we have updates, the revision is to 2009Q2
          revision_impacts = endog2.iloc[-2] * 0.5 ** np.arange(
              4
          ).reshape(4, 1)
      elif revisions:
          revisions_index = pd.MultiIndex.from_arrays(
              [endog1.index[-1:], ["infl"]],
              names=["revision date", "revised variable"],
          )
          # With no updates, the revision is to 2009Q3
          revision_impacts = np.r_[
              0, endog2.iloc[-1] * 0.5 ** np.arange(3)
          ].reshape(4, 1)
      else:
          revisions_index = pd.MultiIndex.from_arrays(
              [[], []], names=["revision date", "revised variable"]
          )
          revision_impacts = None
  
      # Updates
      if updates:
          updates_index = pd.MultiIndex.from_arrays(
              [
                  pd.period_range(start="2009Q3", periods=1, freq="Q"),
                  ["infl"],
              ],
              names=["update date", "updated variable"],
          )
          update_impacts = np.array(
              [
                  [
                      0,
                      endog.loc["2009Q3"] - 0.5 * endog.loc["2009Q2"],
                      0.5 * endog.loc["2009Q3"]
                      - 0.5**2 * endog.loc["2009Q2"],
                      0.5**2 * endog.loc["2009Q3"]
                      - 0.5**3 * endog.loc["2009Q2"],
                  ]
              ]
          ).T
      else:
          updates_index = pd.MultiIndex.from_arrays(
              [[], []], names=["update date", "updated variable"]
          )
          update_impacts = None
      print(update_impacts)
  
      # Impact forecasts
      if updates:
          prev_impacted_forecasts = np.r_[
              endog1.iloc[-1] * 0.5 ** np.arange(4)
          ].reshape(4, 1)
      else:
          prev_impacted_forecasts = np.r_[
              endog1.iloc[-2], endog1.iloc[-1] * 0.5 ** np.arange(3)
          ].reshape(4, 1)
      post_impacted_forecasts = np.r_[
          endog2.iloc[-2], 0.5 ** np.arange(3) * endog2.iloc[-1]
      ].reshape(4, 1)
  
      # News
      if updates:
          # Note: update_forecasts is created using the endog2 dataset even if
          # there were revisions, because it should be computed after revisions
          # have already been taken into account
          update_forecasts = [0.5 * endog2.loc["2009Q2"]]
          update_realized = [endog2.loc["2009Q3"]]
          news_desired = [
              update_realized[i] - update_forecasts[i]
              for i in range(len(update_forecasts))
          ]
          weights = pd.DataFrame(np.r_[0, 0.5 ** np.arange(3)]).T
      else:
          update_forecasts = pd.Series([], dtype=np.float64)
          update_realized = pd.Series([], dtype=np.float64)
          news_desired = pd.Series([], dtype=np.float64)
          weights = pd.DataFrame(np.zeros((0, 4)))
  
      # Run unit tests
      check_news(
          news,
          revisions,
          updates,
          impact_dates,
          impacted_variables,
          revisions_index,
          updates_index,
          revision_impacts,
          update_impacts,
          prev_impacted_forecasts,
          post_impacted_forecasts,
          update_forecasts,
          update_realized,
          news_desired,
          weights,
      )
  
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 6 for calling a global function with example usage: test_sarimax_time_invariant(revisions, updates, revisions_details_start) without return types