code: def test_exhausted_search_space(tmp_path):
      class MyTuner(randomsearch.RandomSearch):
          def run_trial(self, trial, *args, **kwargs):
              hp = trial.hyperparameters
              hp.Boolean("boolean")
              hp.Boolean("boolean2")
              return [np.random.rand()]
  
      tuner = MyTuner(
          max_trials=15,
          directory=tmp_path,
      )
      tuner.search()
      assert len(tuner.oracle.trials) == 4
  
imports: import numpy
  from keras_tuner.backend import keras
  from keras_tuner.engine import tuner
  from keras_tuner.tuners import randomsearch
label_desc: Use image node_id 2 for calling a global function with example usage: test_exhausted_search_space(tmp_path) and returns: list