code: def format_goal(metric_direction: Text) -> Text:
      """Converts oracle_module.Objective 'direction' to study_config 'goal'.
  
      Args:
          metric_direction: If oracle_module.Objective 'direction' is supplied,
              returns 'goal' in Vizier study_config. If 'goal' in
              Vizier 'study_config' is supplied, returns 'direction' in
              oracle_module.Objective.
  
      Returns:
          'goal' or 'direction'.
      """
      if metric_direction == _DIRECTION_MAX:
          return _GOAL_MAXIMIZE
      if metric_direction == _DIRECTION_MIN:
          return _GOAL_MINIMIZE
      if metric_direction == _GOAL_MAXIMIZE:
          return _DIRECTION_MAX
      if metric_direction == _GOAL_MINIMIZE:
          return _DIRECTION_MIN
      return _GOAL_TYPE_UNSPECIFIED
  
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 8 for calling a global function with example usage: format_goal(metric_direction) and returns: _GOAL_TYPE_UNSPECIFIED, _GOAL_MAXIMIZE, _GOAL_MINIMIZE, _DIRECTION_MAX, _DIRECTION_MIN