code: def test_raises():
      """[Model Selection] Test raises on error."""
  
      evl = Evaluator(bad_scorer, verbose=1)
  
      with open(os.devnull, "w") as f, redirect_stdout(f):
          np.testing.assert_raises(
              ValueError,
              evl.fit,
              X,
              y,
              estimators=[OLS()],
              param_dicts={"ols": {"offset": randint(1, 10)}},
              n_iter=1,
          )
  
file_path: mlens/mlens/model_selection/tests/test_model_selection.py
imports: import os
  import numpy
  from mlens.model_selection import Evaluator, benchmark
  from mlens.metrics import mape, make_scorer
  from mlens.utils.exceptions import FitFailedWarning
  from mlens.utils.dummy import OLS, Scale
  from mlens.testing import Data
  from scipy.stats import randint
label_desc: Use image node_id 4 for calling a global function with example usage: test_raises() without return types