code: def test_end_trial_backward_compatible(tmp_path):
      oracle = OracleStub(directory=tmp_path, objective="val_loss")
      trial = oracle.create_trial(tuner_id="a")
      oracle.update_trial(trial.trial_id, {"val_loss": 1.0})
      oracle.end_trial(trial.trial_id, "COMPLETE")
  
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 9 for calling a global function with example usage: test_end_trial_backward_compatible(tmp_path) without return types