code: def convert_completed_vizier_trial_to_keras_trial(
      vizier_trial: Dict[Text, Any],
      hyperparameter_space: hp_module.HyperParameters,
  ) -> trial_module.Trial:
      """Converts completed Vizier Trial into KerasTuner Trial.
  
      Args:
          vizier_trial: A Vizier Trial Instance.
          hyperparameter_space: Mandatory and must include definitions for all
              hyperparameters used during the search.
  
      Returns:
          A KerasTuner Trial.
      """
      keras_tuner_trial = trial_module.Trial(
          hyperparameters=convert_vizier_trial_to_hps(
              hyperparameter_space, vizier_trial
          ),
          trial_id=get_trial_id(vizier_trial),
          status=trial_module.TrialStatus.COMPLETED,
      )
      # If trial had ended before having intermediate metric reporting,
      # set stepCount = 0.
      final_measurement = vizier_trial.get("finalMeasurement")
      if not final_measurement:
          raise ValueError(
              '"finalMeasurement" not found in this trial {}'.format(
                  vizier_trial
              )
          )
  
      keras_tuner_trial.best_step = int(
          final_measurement.get("stepCount", 0)
      )
      keras_tuner_trial.score = final_measurement["metrics"][0].get(
          "value"
      )
      return keras_tuner_trial
  
imports: from typing import Any, Dict, List, Optional, Text, Union
  from keras_tuner.engine import hyperparameters
  from keras_tuner.engine import metrics_tracking
  from keras_tuner.engine import oracle
  from keras_tuner.engine import trial
  import numpy
  from tensorboard.plugins.hparams import api
label_desc: Use image node_id 13 for calling a global function with example usage: convert_completed_vizier_trial_to_keras_trial(vizier_trial, hyperparameter_space) and returns: keras_tuner_trial