code: def test_date_indexes(reset_randomstate, freq_M, freq_Q):
      # Test that using either PeriodIndex or DatetimeIndex for monthly or
      # quarterly data, with a variety of DatetimeIndex frequencies, works
  
      # Monthly datasets
      nobs_M = 10
      dates_M = pd.date_range(start="2000", periods=nobs_M, freq=freq_M)
      periods_M = pd.period_range(
          start="2000", periods=nobs_M, freq="M"
      )
      dta_M = np.random.normal(size=(nobs_M, 2))
      endog_period_M = pd.DataFrame(dta_M.copy(), index=periods_M)
      endog_date_M = pd.DataFrame(dta_M.copy(), index=dates_M)
  
      # Quarterly datasets
      nobs_Q = 3
      dates_Q = pd.date_range(start="2000", periods=nobs_Q, freq=freq_Q)
      periods_Q = pd.period_range(
          start="2000", periods=nobs_Q, freq="Q"
      )
      dta_Q = np.random.normal(size=(nobs_Q, 2))
      endog_period_Q = pd.DataFrame(dta_Q.copy(), index=periods_Q)
      endog_date_Q = pd.DataFrame(dta_Q.copy(), index=dates_Q)
  
      # Baseline is monthly periods and quarterly periods
      mod_base = dynamic_factor_mq.DynamicFactorMQ(
          endog_period_M, endog_quarterly=endog_period_Q
      )
  
      # Test against monthly dates and quarterly dates
      mod = dynamic_factor_mq.DynamicFactorMQ(
          endog_date_M, endog_quarterly=endog_date_Q
      )
      assert_(mod._index.equals(mod_base._index))
      assert_allclose(mod.endog, mod_base.endog)
  
      # Test against monthly dates and quarterly periods
      mod = dynamic_factor_mq.DynamicFactorMQ(
          endog_date_M, endog_quarterly=endog_period_Q
      )
      assert_(mod._index.equals(mod_base._index))
      assert_allclose(mod.endog, mod_base.endog)
  
      # Test against monthly periods and quarterly dates
      mod = dynamic_factor_mq.DynamicFactorMQ(
          endog_period_M, endog_quarterly=endog_date_Q
      )
      assert_(mod._index.equals(mod_base._index))
      assert_allclose(mod.endog, mod_base.endog)
  
imports: from statsmodels.compat.pandas import MONTH_END, QUARTER_END, assert_frame_equal, assert_series_equal
  import numpy
  from numpy.testing import assert_, assert_allclose, assert_equal
  import pandas
  import pytest
  from statsmodels.regression.linear_model import OLS
  from statsmodels.tools import add_constant
  from statsmodels.tsa.statespace import dynamic_factor, dynamic_factor_mq, sarimax
  from statsmodels.tsa.statespace.tests import test_dynamic_factor_mq_monte_carlo
label_desc: Use image node_id 7 for calling a global function with example usage: test_date_indexes(reset_randomstate, freq_M, freq_Q) without return types