code: def check_news_indices(news, updates_index, impact_dates):
      # News are computed only from updates, so the news indices are the same as
      # the update indices
      if len(updates_index):
          news_index = updates_index
      else:
          news_index = pd.MultiIndex.from_product(
              [[], []], names=["update date", "updated variable"]
          )
      endog_names = news.previous.model.endog_names
      if isinstance(endog_names, str):
          endog_names = [endog_names]
  
      assert_(news.news.index.equals(news_index))
      assert_(news.update_forecasts.index.equals(news_index))
      assert_(news.update_realized.index.equals(news_index))
      assert_(news.weights.index.equals(news_index))
  
      weights_columns = pd.MultiIndex.from_product(
          [impact_dates, endog_names]
      )
      assert_(news.weights.columns.equals(weights_columns))
  
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 4 for calling a global function with example usage: check_news_indices(news, updates_index, impact_dates) without return types