code: def test_exceptions():
      if debug_mode:
          if "exceptions" not in to_test:  # pragma: no cover
              return
          else:
              print("\n\nEXCEPTIONS\n", end="")
      ds = datasets[0]
      dt = ds.dt_s_list[0]
      endog = data[datasets[0]]
  
      # select_coint_rank:
      # method argument cannot be "my_method"
      assert_raises(
          ValueError, select_coint_rank, endog, 0, 3, "my_method", 0.05
      )
      # det_order has to be -1, 0, or 1:
      assert_raises(ValueError, select_coint_rank, endog, 2, 3)
      assert_raises(ValueError, select_coint_rank, endog, 0.5, 3)
      # 0.025 is not possible (must be 0.1, 0.05, or 0.01)
      assert_raises(
          ValueError, select_coint_rank, endog, 0, 3, "trace", 0.025
      )
  
      # Granger_causality:
      # ### 0<signif<1
      # this means signif=0
      assert_raises(
          ValueError,
          results_sm[ds][dt].test_granger_causality,
          0,
          None,
          0,
      )
      # ### caused must be int, str or iterable of int or str
      # 0.5 not int
      assert_raises(
          TypeError, results_sm[ds][dt].test_granger_causality, [0.5]
      )
      # ### causing must be None, int, str or iterable of int or str
      # .5 not int
      assert_raises(
          TypeError, results_sm[ds][dt].test_granger_causality, 0, 0.5
      )
  
      # exceptions in VECM class
      # ### choose only one of the two: "co" and "ci"
      model = VECM(endog, k_ar_diff=1, deterministic="cico")
      assert_raises(ValueError, model.fit)
      # ### we analyze multiple time series
      univariate_data = endog[0]
      assert_raises(ValueError, VECM, univariate_data)
      # ### fit only allowed with known method
      model = VECM(endog, k_ar_diff=1, deterministic="n")
      assert_raises(
          ValueError, model.fit, "abc"
      )  # no "abc" estim.-method
  
      # pass a shorter array than endog as exog_coint argument
      assert_raises(
          ValueError, VECM, endog, None, np.ones(len(endog) - 1)
      )
      # forecasting: argument checks
      STEPS = 5
      # ### with exog
      exog = seasonal_dummies(
          4, len(endog), 2, centered=True
      )  # seasonal...
      exog = np.hstack(
          (exog, 1 + np.arange(len(endog)).reshape(-1, 1))
      )  # & lin
      vecm_res = VECM(
          endog,
          exog,
          k_ar_diff=3,
          coint_rank=coint_rank,
          deterministic="co",
      ).fit()
      # ##### exog_fc not passed as argument:
      assert_raises_regex(
          ValueError, "exog_fc is None.*", vecm_res.predict
      )
      # ##### exog_fc is too short:
      exog_fc = np.ones(STEPS)
      assert_raises_regex(
          ValueError,
          ".*exog_fc must have at least steps elements.*",
          vecm_res.predict,
          5,
          None,
          exog_fc[:2],
      )  # [:2] shortens exog_fc
      # ##### exog_coint_fc (NOT exog_fc) is passed when there is no exog_coint
      assert_raises_regex(
          ValueError,
          ".*exog_coint attribute is None.*",
          vecm_res.predict,
          5,
          None,
          exog_fc,
          exog_fc,
      )  # passed as exog_coint_fc-argument!
      # ### with exog_coint
      exog_coint = []
      exog_coint.append(np.ones(len(endog)).reshape(-1, 1))
      exog_coint.append(1 + np.arange(len(endog)).reshape(-1, 1))
      exog_coint = np.hstack(exog_coint)
      vecm_res = VECM(
          endog, k_ar_diff=1, deterministic="n", exog_coint=exog_coint
      ).fit()
      # ##### exog_coint_fc not passed as argument:
      assert_raises_regex(
          ValueError, "exog_coint_fc is None.*", vecm_res.predict
      )
      # ##### exog_coint_fc is too short:
      exog_coint_fc = np.ones(STEPS)
      assert_raises_regex(
          ValueError,
          ".*exog_coint_fc must have at least steps elements.*",
          vecm_res.predict,
          5,
          None,
          None,
          exog_coint_fc[:2],
      )  # [:2] shortens
      # ##### exog_fc (NOT exog_coint_fc) is passed when there is no exog
      assert_raises_regex(
          ValueError,
          ".*exog attribute is None.*",
          vecm_res.predict,
          5,
          None,
          exog_coint_fc,
      )
  
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 24 for calling a global function with example usage: test_exceptions() without return types