code: def test_impulse_response():
      if debug_mode:
          if "impulse-response" not in to_test:
              return
          else:
              print("\n\nIMPULSE-RESPONSE", end="")
      for ds in datasets:
          for dt in dt_s_list:
              if debug_mode:
                  print("\n" + dt_s_tup_to_string(dt) + ": ", end="")
              err_msg = build_err_msg(ds, dt, "IMULSE-RESPONSE")
              periods = 20
              obtained_all = (
                  results_sm[ds][dt].irf(periods=periods).irfs
              )
              # flatten inner arrays to make them comparable to parsed results:
              obtained_all = obtained_all.reshape(periods + 1, -1)
              desired_all = results_ref[ds][dt]["ir"]
              assert_allclose(
                  obtained_all, desired_all, rtol, atol, False, err_msg
              )
  
imports: import numpy
  from numpy.testing import assert_, assert_allclose, assert_raises
  import statsmodels.datasets.macrodata.data
  from statsmodels.tsa.vector_ar.tests.JMulTi_results.parse_jmulti_vecm_output import sublists
  from statsmodels.tsa.vector_ar.var_model import VAR
  from .JMulTi_results.parse_jmulti_var_output import dt_s_tup_to_string, load_results_jmulti
label_desc: Use image node_id 13 for calling a global function with example usage: test_impulse_response() without return types