code: def test_save_best_epoch_with_default_objective(tmp_path):
      objective = obj_module.create_objective(None)
      filepath = os.path.join(tmp_path, "saved_weights.weights.h5")
      callback = tuner_utils.SaveBestEpoch(objective, filepath)
  
      model = keras.Sequential([keras.layers.Dense(1)])
      model.compile(loss="mse")
      val_x = np.random.rand(10, 10)
      val_y = np.random.rand(10, 10)
      history = model.fit(
          x=np.random.rand(10, 10),
          y=np.random.rand(10, 1),
          validation_data=(val_x, val_y),
          epochs=10,
          callbacks=[callback],
      )
  
      model.load_weights(filepath)
  
      assert history.history["val_loss"][-1] == model.evaluate(
          val_x, val_y
      )
  
file_path: keras-tuner/keras_tuner/engine/tuner_utils_test.py
imports: import os
  import numpy
  import pytest
  from keras_tuner.backend import keras
  from keras_tuner.engine import objective
  from keras_tuner.engine import tuner_utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_save_best_epoch_with_default_objective(tmp_path) without return types