code: def create_summary_metadata(hparams_plugin_data_pb):
      """Returns a summary metadata for the HParams plugin.
  
      Returns a summary_pb2.SummaryMetadata holding a copy of the given
      HParamsPluginData message in its plugin_data.content field.
      Sets the version field of the hparams_plugin_data_pb copy to
      PLUGIN_DATA_VERSION.
  
      Args:
        hparams_plugin_data_pb: the HParamsPluginData protobuffer to use.
      """
      if not isinstance(
          hparams_plugin_data_pb, plugin_data_pb2.HParamsPluginData
      ):
          raise TypeError(
              "Needed an instance of plugin_data_pb2.HParamsPluginData."
              " Got: %s" % type(hparams_plugin_data_pb)
          )
      content = plugin_data_pb2.HParamsPluginData()
      content.CopyFrom(hparams_plugin_data_pb)
      content.version = PLUGIN_DATA_VERSION
      return summary_pb2.SummaryMetadata(
          plugin_data=summary_pb2.SummaryMetadata.PluginData(
              plugin_name=PLUGIN_NAME,
              content=content.SerializeToString(),
          )
      )
  
file_path: tensorboard/tensorboard/plugins/hparams/metadata.py
imports: from tensorboard.compat.proto import summary_pb2
  from tensorboard.compat.proto import types_pb2
  from tensorboard.plugins.hparams import error
  from tensorboard.plugins.hparams import plugin_data_pb2
  from tensorboard.util import tensor_util
label_desc: Use image node_id 1 for calling a global function with example usage: create_summary_metadata(hparams_plugin_data_pb) and returns: summary_pb2