code: def test_resource_parameter(Est):
      # Test the resource parameter
  
      n_samples = 1000
      X, y = make_classification(n_samples=n_samples, random_state=0)
      param_grid = {"a": [1, 2], "b": list(range(10))}
      base_estimator = FastClassifier()
      sh = Est(
          base_estimator,
          param_grid,
          cv=2,
          resource="c",
          max_resources=10,
          factor=3,
      )
      sh.fit(X, y)
      assert set(sh.n_resources_) == set([1, 3, 9])
      for r_i, params, param_c in zip(
          sh.cv_results_["n_resources"],
          sh.cv_results_["params"],
          sh.cv_results_["param_c"],
      ):
          assert r_i == params["c"] == param_c
  
      with pytest.raises(
          ValueError,
          match="Cannot use resource=1234 which is not supported ",
      ):
          sh = HalvingGridSearchCV(
              base_estimator,
              param_grid,
              cv=2,
              resource="1234",
              max_resources=10,
          )
          sh.fit(X, y)
  
      with pytest.raises(
          ValueError,
          match=(
              "Cannot use parameter c as the resource since it is part "
              "of the searched parameters."
          ),
      ):
          param_grid = {"a": [1, 2], "b": [1, 2], "c": [1, 3]}
          sh = HalvingGridSearchCV(
              base_estimator,
              param_grid,
              cv=2,
              resource="c",
              max_resources=10,
          )
          sh.fit(X, y)
  
imports: from math import ceil
  import numpy
  import pytest
  from scipy.stats import expon, norm, randint
  from sklearn.datasets import make_classification
  from sklearn.dummy import DummyClassifier
  from sklearn.experimental import enable_halving_search_cv
  from sklearn.model_selection import GroupKFold, GroupShuffleSplit, HalvingGridSearchCV, HalvingRandomSearchCV, KFold, LeaveOneGroupOut, LeavePGroupsOut, ShuffleSplit, StratifiedKFold, StratifiedShuffleSplit
  from sklearn.model_selection._search_successive_halving import _SubsampleMetaSplitter, _top_k
  from sklearn.model_selection.tests.test_search import check_cv_results_array_types, check_cv_results_keys
  from sklearn.svm import SVC, LinearSVC
label_desc: Use image node_id 5 for calling a global function with example usage: test_resource_parameter(Est) without return types