code: def test_oracle_idle(tmp_path):
      class MyOracle(randomsearch.RandomSearchOracle):
          def __init__(self, *args, **kwargs):
              super().__init__(*args, **kwargs)
              self._first_trial = True
  
          def create_trial(self, *args, **kwargs):
              trial = super().create_trial(*args, **kwargs)
              if self._first_trial:
                  self._first_trial = False
                  trial.status = "IDLE"
              else:
                  trial.status = "STOPPED"
              return trial
  
      class MyTuner(base_tuner.BaseTuner):
          def run_trial(self, trial, *args, **kwargs):
              trial.hyperparameters.Boolean("foo")
              trial.hyperparameters.Boolean("bar")
              return np.random.rand()
  
      tuner = MyTuner(oracle=MyOracle(max_trials=3), directory=tmp_path)
      tuner.search()
  
imports: import os
  import pickle
  import time
  import numpy
  import pytest
  from sklearn import linear_model
  import keras_tuner
  from keras_tuner import errors
  from keras_tuner.distribute import oracle_client
  from keras_tuner.engine import base_tuner
  from keras_tuner.test_utils import mock_distribute
  from keras_tuner.tuners import gridsearch
  from keras_tuner.tuners import randomsearch
label_desc: Use image node_id 2 for calling a global function with example usage: test_oracle_idle(tmp_path) and returns: trial, np