code: def test_hyperband_save_and_restore(tmp_path):
      tuner = hyperband_module.Hyperband(
          objective="val_loss",
          hypermodel=build_model,
          hyperband_iterations=1,
          max_epochs=7,
          factor=2,
          directory=tmp_path,
      )
  
      x, y = np.ones((2, INPUT_DIM)), np.ones((2, 1))
      tuner.search(x, y, validation_data=(x, y))
  
      num_trials = len(tuner.oracle.trials)
      assert num_trials > 0
      assert tuner.oracle._current_iteration == 0
  
      tuner.save()
      tuner.trials = {}
      tuner.oracle._current_iteration = 0
      tuner.reload()
  
      assert len(tuner.oracle.trials) == num_trials
      assert tuner.oracle._current_iteration == 0
  
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 6 for calling a global function with example usage: test_hyperband_save_and_restore(tmp_path) without return types