docstr: Verifies that best hparams and tuning results are saved.
docstr_tok: ["Verifies","that","best","hparams","and","tuning","results","are","saved","."]
code: def _verify_output(self):
      """Verifies that best hparams and tuning results are saved."""
      best_hparams_path = os.path.join(
          self._best_hparams.uri, executor._DEFAULT_BEST_HP_FILE_NAME
      )
      self.assertTrue(fileio.exists(best_hparams_path))
      best_hparams_config = json.loads(
          file_io.read_file_to_string(best_hparams_path)
      )
      best_hparams = HyperParameters.from_config(best_hparams_config)
      self.assertIn(best_hparams.get("learning_rate"), (1e-1, 1e-3))
      self.assertBetween(best_hparams.get("num_layers"), 1, 5)
  
      tuner_results_path = os.path.join(
          self._tuner_results.uri,
          executor._DEFAULT_TUNER_RESULTS_FILE_NAME,
      )
      self.assertTrue(fileio.exists(tuner_results_path))
      tuner_results = json.loads(
          file_io.read_file_to_string(tuner_results_path)
      )
      self.assertLen(tuner_results, 3)
      self.assertEqual(
          {"trial_id", "score", "learning_rate", "num_layers"},
          tuner_results[0].keys(),
      )
  
imports: import copy
  import json
  import os
  from keras_tuner import HyperParameters
  import tensorflow
  from tfx.components.testdata.module_file import tuner_module
  from tfx.components.tuner import executor
  from tfx.dsl.io import fileio
  from tfx.proto import trainer_pb2
  from tfx.proto import tuner_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_artifacts
  from tfx.types import standard_component_specs
  from tfx.utils import io_utils
  from tfx.utils import name_utils
  from tfx.utils import proto_utils
  from tensorflow.python.lib.io import file_io
label_desc: Use image node_id 2 for calling the ExecutorTest obj's underlying member method code with example usage: obj._verify_output() without return types