code: def test_exceptions(self):
      # Empty model list
      assert_raises(ValueError, stacking, [], X_train, y_train, X_test)
      # Wrong mode
      assert_raises(
          ValueError,
          stacking,
          [LinearRegression()],
          X_train,
          y_train,
          X_test,
          mode="abc",
      )
      # Path does not exist
      assert_raises(
          ValueError,
          stacking,
          [LinearRegression()],
          X_train,
          y_train,
          X_test,
          save_dir="./As26bV85",
      )
      # n_folds is not int
      assert_raises(
          ValueError,
          stacking,
          [LinearRegression()],
          X_train,
          y_train,
          X_test,
          n_folds="A",
      )
      # n_folds is less than 2
      assert_raises(
          ValueError,
          stacking,
          [LinearRegression()],
          X_train,
          y_train,
          X_test,
          n_folds=1,
      )
      # Wrong verbose value
      assert_raises(
          ValueError,
          stacking,
          [LinearRegression()],
          X_train,
          y_train,
          X_test,
          verbose=25,
      )
  
      # Internal function model_action
      assert_raises(
          ValueError,
          model_action,
          LinearRegression(),
          X_train,
          y_train,
          X_test,
          sample_weight=None,
          action="abc",
          transform=None,
      )
  
      # X_test is None when mode != 'oof'
      assert_raises(
          ValueError,
          stacking,
          [LinearRegression()],
          X_train,
          y_train,
          None,
          mode="oof_pred_bag",
      )
  
imports: from __future__ import print_function
  from __future__ import division
  import unittest
  from numpy.testing import assert_array_equal
  from numpy.testing import assert_equal
  from numpy.testing import assert_raises
  from numpy.testing import assert_warns
  import os
  import glob
  import numpy
  from scipy.sparse import csr_matrix
  from scipy.sparse import csc_matrix
  from scipy.sparse import coo_matrix
  from sklearn.model_selection import cross_val_predict
  from sklearn.model_selection import cross_val_score
  from sklearn.model_selection import KFold
  from sklearn.datasets import load_boston
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import make_scorer
  from sklearn.linear_model import LinearRegression
  from sklearn.linear_model import Ridge
  from vecstack import stacking
  from vecstack.core import model_action
label_desc: Use image node_id 24 for calling the TestFuncRegression obj's underlying member method code with example usage: obj.test_exceptions() without return types