code: def export_module_spec_with_checkpoint(
      module_spec, checkpoint_path, export_path, scope_prefix=""
  ):
      """Exports given checkpoint as tfhub module with given spec."""
  
      # The main requirement is that it is possible to know how to map from
      # module variable name to checkpoint variable name.
      # This is trivial if the original code used variable scopes,
      # but can be messy if the variables to export are interwined
      # with variables not export.
      with tf.Graph().as_default():
          m = hub.Module(module_spec)
          assign_map = {
              scope_prefix + name: value
              for name, value in m.variable_map.items()
          }
          tf.train.init_from_checkpoint(checkpoint_path, assign_map)
          init_op = tf.initializers.global_variables()
          with tf.Session() as session:
              session.run(init_op)
              m.export(export_path, session)
  
file_path: tensor2tensor/tensor2tensor/serving/export.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from tensor2tensor.bin import t2t_trainer
  from tensor2tensor.utils import decoding
  from tensor2tensor.utils import t2t_model
  from tensor2tensor.utils import trainer_lib
  from tensor2tensor.utils import usr_dir
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tensorflow_hub
label_desc: Use image node_id 4 for calling a global function with example usage: export_module_spec_with_checkpoint(module_spec, checkpoint_path, export_path, scope_prefix) without return types