code: def test_synchronized_functions_in_same_oracle_diff_function(
      tmp_path,
  ):
      class MyOracle(OracleStub):
          def __init__(self, *args, **kwargs):
              super().__init__(*args, **kwargs)
              self.log = []
  
          @oracle_module.synchronized
          def create_trial(self, tuner_id):
              self.log.append("create")
              time.sleep(0.5)
              self.log.append("create")
              return super().create_trial(tuner_id)
  
          @oracle_module.synchronized
          def end_trial(self, trial):
              self.log.append("end")
              time.sleep(0.5)
              self.log.append("end")
              return super().end_trial(trial)
  
      oracle = MyOracle(
          directory=tmp_path,
          objective="val_loss",
      )
  
      trial = oracle.create_trial(tuner_id="a")
      trial.status = trial_module.TrialStatus.COMPLETED
      oracle.update_trial(trial.trial_id, metrics={"val_loss": 0.5})
  
      def thread_function_create():
          oracle.create_trial(tuner_id="b")
  
      def thread_function_end():
          oracle.end_trial(trial)
  
      thread_create = threading.Thread(target=thread_function_create)
      thread_end = threading.Thread(target=thread_function_end)
  
      thread_create.start()
      thread_end.start()
  
      thread_create.join()
      thread_end.join()
  
      for i in range(2):
          # The same ID should be next to each other.
          # No other thread interupting between start and end.
          assert oracle.log[i * 2] == oracle.log[i * 2 + 1]
  
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 19 for calling a global function with example usage: test_synchronized_functions_in_same_oracle_diff_function(tmp_path) and returns: super, super