code: def check_equivalent_models(mod, mod2):
      attrs = [
          "level",
          "trend",
          "seasonal_periods",
          "seasonal",
          "freq_seasonal_periods",
          "freq_seasonal_harmonics",
          "freq_seasonal",
          "cycle",
          "ar_order",
          "autoregressive",
          "irregular",
          "stochastic_level",
          "stochastic_trend",
          "stochastic_seasonal",
          "stochastic_freq_seasonal",
          "stochastic_cycle",
          "damped_cycle",
          "mle_regression",
          "trend_specification",
          "trend_mask",
          "regression",
          "cycle_frequency_bound",
      ]
  
      ssm_attrs = [
          "nobs",
          "k_endog",
          "k_states",
          "k_posdef",
          "obs_intercept",
          "design",
          "obs_cov",
          "state_intercept",
          "transition",
          "selection",
          "state_cov",
      ]
  
      for attr in attrs:
          assert_equal(getattr(mod2, attr), getattr(mod, attr))
  
      for attr in ssm_attrs:
          assert_equal(getattr(mod2.ssm, attr), getattr(mod.ssm, attr))
  
      assert_equal(mod2._get_init_kwds(), mod._get_init_kwds())
  
imports: import warnings
  import numpy
  from numpy.testing import assert_equal, assert_allclose, assert_raises
  import pandas
  import pytest
  from statsmodels.datasets import macrodata
  from statsmodels.tools.sm_exceptions import SpecificationWarning
  from statsmodels.tsa.statespace import structural
  from statsmodels.tsa.statespace.structural import UnobservedComponents
  from statsmodels.tsa.statespace.tests.results import results_structural
label_desc: Use image node_id 30 for calling a global function with example usage: check_equivalent_models(mod, mod2) without return types