code: def test_no_halt_with_error(
      param_dist: dict[str, distributions.BaseDistribution],
      all_params: list[int],
  ) -> None:
      X, y = make_regression(n_samples=100, n_features=10)
      estimator = DecisionTreeRegressor()
      study = create_study(
          sampler=BruteForceSampler(), direction="maximize"
      )
  
      # DecisionTreeRegressor raises ValueError when max_depth==0.
      optuna_search = integration.OptunaSearchCV(
          estimator,
          param_dist,
          study=study,
      )
      optuna_search.fit(X, y)
      all_suggested_values = [
          t.params["max_depth"] for t in study.trials
      ]
      assert len(all_suggested_values) == len(all_params)
      for a in all_params:
          assert a in all_suggested_values
  
imports: from __future__ import annotations
  from unittest.mock import MagicMock
  from unittest.mock import patch
  import warnings
  import numpy
  import pytest
  import scipy
  from sklearn.datasets import make_blobs
  from sklearn.datasets import make_regression
  from sklearn.decomposition import PCA
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.exceptions import NotFittedError
  from sklearn.linear_model import LogisticRegression
  from sklearn.linear_model import SGDClassifier
  from sklearn.neighbors import KernelDensity
  from sklearn.tree import DecisionTreeRegressor
  from optuna import distributions
  from optuna import integration
  from optuna.samplers import BruteForceSampler
  from optuna.study import create_study
  from optuna.terminator.erroreval import _CROSS_VALIDATION_SCORES_KEY
label_desc: Use image node_id 18 for calling a global function with example usage: test_no_halt_with_error(param_dist, all_params) without return types