code: def test_var_to_vecm():
      if debug_mode:
          if (
              "VAR to VEC representation" not in to_test
          ):  # pragma: no cover
              return
          print("\n\nVAR TO VEC", end="")
      for ds in datasets:
          for dt in ds.dt_s_list:
              if debug_mode:
                  print("\n" + dt_s_tup_to_string(dt) + ": ", end="")
  
              err_msg = build_err_msg(
                  ds, dt, "VAR to VEC representation"
              )
              sigma_u = results_sm[ds][dt].sigma_u
              coefs = results_sm[ds][dt].var_rep
              intercept = np.zeros(len(sigma_u))
              # Note: _params_info k_trend, k_exog, ... is inferred with defaults
              var = VARProcess(coefs, intercept, sigma_u)
              vecm_results = var.to_vecm()
              obtained_pi = vecm_results["Pi"]
              obtained_gamma = vecm_results["Gamma"]
  
              desired_pi = np.dot(
                  results_sm[ds][dt].alpha, results_sm[ds][dt].beta.T
              )
              desired_gamma = results_sm[ds][dt].gamma
              assert_allclose(
                  obtained_pi,
                  desired_pi,
                  rtol,
                  atol,
                  False,
                  err_msg + " Pi",
              )
              assert_allclose(
                  obtained_gamma,
                  desired_gamma,
                  rtol,
                  atol,
                  False,
                  err_msg + " Gamma",
              )
  
imports: import numpy
  from numpy.testing import assert_, assert_allclose, assert_array_equal, assert_raises, assert_raises_regex
  import pytest
  import statsmodels.datasets.interest_inflation.data
  from statsmodels.tools.testing import assert_equal
  from statsmodels.tsa.vector_ar.tests.JMulTi_results.parse_jmulti_vecm_output import dt_s_tup_to_string, load_results_jmulti, sublists
  from statsmodels.tsa.vector_ar.util import seasonal_dummies
  from statsmodels.tsa.vector_ar.var_model import VARProcess
  from statsmodels.tsa.vector_ar.vecm import VECM, select_coint_rank, select_order
label_desc: Use image node_id 14 for calling a global function with example usage: test_var_to_vecm() without return types