code: def test_lag_order_selection():
      if debug_mode:
          if "lag order" not in to_test:
              return
          else:
              print("\n\nLAG ORDER SELECTION", end="")
      for ds in datasets:
          for dt in dt_s_list:
              if debug_mode:
                  print("\n" + dt_s_tup_to_string(dt) + ": ", end="")
              endog_tot = data[ds]
              exog = generate_exog_from_season(dt[1], len(endog_tot))
              model = VAR(endog_tot, exog)
              trend = "n" if dt[0] == "nc" else dt[0]
              obtained_all = model.select_order(10, trend=trend)
              for ic in ["aic", "fpe", "hqic", "bic"]:
                  err_msg = build_err_msg(
                      ds, dt, "LAG ORDER SELECTION - " + ic.upper()
                  )
                  obtained = getattr(obtained_all, ic)
                  desired = results_ref[ds][dt]["lagorder"][ic]
                  assert_allclose(
                      obtained, desired, 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 14 for calling a global function with example usage: test_lag_order_selection() without return types