code: def get_hparams_from_dir(model_directory, tower_name):
      hparams = hparam_pb2.HParamDef()
      with tf.io.gfile.GFile(
          os.path.join(model_directory, tower_name), "r"
      ) as f:
          text_format.Parse(f.read(), hparams)
      output = hp.HParams(hparam_def=hparams)
      return output
  
imports: import collections
  import os
  import string
  import time
  from absl import flags
  from absl import logging
  from model_search import block
  from model_search import block_builder
  from model_search import hparam
  from model_search import utils
  from model_search.proto import hparam_pb2
  from model_search.proto import phoenix_spec_pb2
  from model_search.proto import transfer_learning_spec_pb2
  import numpy
  import tensorflow.compat.v2
  import tf_slim
  from google.protobuf import text_format
label_desc: Use image node_id 3 for calling a global function with example usage: get_hparams_from_dir(model_directory, tower_name) and returns: output