code: def test_duplicate(tmp_path):
      class MyOracle(OracleStub):
          def populate_space(self, trial_id):
              values = {"hp1": 1}
              if len(self.ongoing_trials) > 0:
                  assert self._duplicate(values)
              return {
                  "values": values,
                  "status": trial_module.TrialStatus.RUNNING,
              }
  
      oracle = MyOracle(directory=tmp_path, objective="val_loss")
      oracle.create_trial(tuner_id="a")
      oracle.create_trial(tuner_id="b")
      assert len(oracle.ongoing_trials) == 2
  
imports: import datetime
  import threading
  import time
  import numpy
  import pytest
  import keras_tuner
  from keras_tuner.engine import oracle
  from keras_tuner.engine import trial
  from keras_tuner.tuners import gridsearch
label_desc: Use image node_id 8 for calling a global function with example usage: test_duplicate(tmp_path) and returns: dict