code: def test_start_end_int(which):
      endog = dta["infl"].copy()
      nobs = len(endog)
      if which == "range":
          endog.index = pd.RangeIndex(nobs)
          endog_init = endog.iloc[:-1]
          index_plus2 = pd.RangeIndex(nobs + 2)
      if which == "range2":
          endog.index = pd.RangeIndex(stop=nobs * 2, step=2)
          endog_init = endog.iloc[:-1]
          index_plus2 = pd.RangeIndex((nobs + 2) * 2, step=2)
      elif which == "int64":
          endog.index = pd.Index(np.arange(nobs))
          endog_init = endog.iloc[:-1]
          index_plus2 = pd.Index(np.arange(nobs + 2))
      elif which == "numpy":
          endog = endog.values
          endog_init = endog[:-1]
          index_plus2 = pd.RangeIndex(nobs + 2)
      elif which == "list":
          endog = endog.tolist()
          endog_init = endog[:-1]
          index_plus2 = pd.RangeIndex(nobs + 2)
  
      mod = sarimax.SARIMAX(endog_init)
      res = mod.smooth([0.5, 1.0])
  
      # Default is the last in-sample period
      news = res.news(endog)
      desired = index_plus2[-4:-3]
      assert_(news.total_impacts.index.equals(desired))
  
      # Start, periods
      news = res.news(endog, start=mod.nobs - 1, periods=1)
      desired = index_plus2[-4:-3]
      assert_(news.total_impacts.index.equals(desired))
      news = res.news(endog, start=mod.nobs - 2, periods=2)
      desired = index_plus2[-5:-3]
      assert_(news.total_impacts.index.equals(desired))
  
      # End, periods
      news = res.news(endog, end=mod.nobs - 1, periods=1)
      desired = index_plus2[-4:-3]
      assert_(news.total_impacts.index.equals(desired))
      news = res.news(endog, end=mod.nobs - 2, periods=2)
      desired = index_plus2[-6:-4]
      assert_(news.total_impacts.index.equals(desired))
  
      # Start, end
      # Note: end is inclusive, like `get_prediction`.
      news = res.news(endog, start=mod.nobs - 2, end=mod.nobs - 1)
      desired = index_plus2[-5:-3]
      assert_(news.total_impacts.index.equals(desired))
      if which not in ["numpy", "list"]:
          predicted = res.predict(start=mod.nobs - 2, end=mod.nobs - 1)
          assert_(news.total_impacts.index.equals(predicted.index))
  
      news = res.news(endog, start=mod.nobs, end=mod.nobs)
      desired = index_plus2[-3:-2]
      assert_(news.total_impacts.index.equals(desired))
      if which not in ["numpy", "list"]:
          predicted = res.predict(start=mod.nobs, end=mod.nobs)
          assert_(news.total_impacts.index.equals(predicted.index))
  
      news = res.news(endog, start=mod.nobs, end=mod.nobs + 1)
      desired = index_plus2[-3:-1]
      assert_(news.total_impacts.index.equals(desired))
      if which not in ["numpy", "list"]:
          predicted = res.predict(start=mod.nobs, end=mod.nobs + 1)
          assert_(news.total_impacts.index.equals(predicted.index))
  
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 15 for calling a global function with example usage: test_start_end_int(which) without return types