code: def test_hyperband_oracle_one_sweep_parallel(tmp_path):
      hp = keras_tuner.HyperParameters()
      hp.Float("a", -100, 100)
      hp.Float("b", -100, 100)
      oracle = hyperband_module.HyperbandOracle(
          hyperparameters=hp,
          objective=keras_tuner.Objective("score", "max"),
          hyperband_iterations=1,
          max_epochs=4,
          factor=2,
      )
      oracle._set_project_dir(tmp_path, "untitled")
  
      # All round 0 trials from different brackets can be run
      # in parallel.
      round0_trials = []
      for i in range(10):
          t = oracle.create_trial(f"tuner{str(i)}")
          assert t.status == "RUNNING"
          round0_trials.append(t)
  
      assert len(oracle._brackets) == 3
  
      # Round 1 can't be run until enough models from round 0
      # have completed.
      t = oracle.create_trial("tuner10")
      assert t.status == "IDLE"
  
      for t in round0_trials:
          oracle.update_trial(t.trial_id, {"score": 1})
          t.status = "COMPLETED"
          oracle.end_trial(t)
  
      round1_trials = []
      for i in range(4):
          t = oracle.create_trial(f"tuner{str(i)}")
          assert t.status == "RUNNING"
          round1_trials.append(t)
  
      # Bracket 0 is complete as it only has round 0.
      assert len(oracle._brackets) == 2
  
      # Round 2 can't be run until enough models from round 1
      # have completed.
      t = oracle.create_trial("tuner10")
      assert t.status == "IDLE"
  
      for t in round1_trials:
          oracle.update_trial(t.trial_id, {"score": 1})
          t.status = "COMPLETED"
          oracle.end_trial(t)
  
      # Only one trial runs in round 2.
      round2_trial = oracle.create_trial("tuner0")
  
      assert len(oracle._brackets) == 1
  
      # No more trials to run, but wait for existing brackets to end.
      t = oracle.create_trial("tuner10")
      assert t.status == "IDLE"
  
      oracle.update_trial(round2_trial.trial_id, {"score": 1})
      round2_trial.status = "COMPLETED"
      oracle.end_trial(round2_trial)
  
      t = oracle.create_trial("tuner10")
      assert t.status == "STOPPED", oracle._current_sweep
  
file_path: keras-tuner/keras_tuner/tuners/hyperband_test.py
imports: import numpy
  import pytest
  import keras_tuner
  from keras_tuner import backend
  from keras_tuner import utils
  from keras_tuner.backend import keras
  from keras_tuner.engine import tuner_utils
  from keras_tuner.tuners import hyperband
label_desc: Use image node_id 4 for calling a global function with example usage: test_hyperband_oracle_one_sweep_parallel(tmp_path) without return types