code: def _summary(tag, hparams_plugin_data):
      """Returns a summary holding the given HParamsPluginData message.
  
      Helper function.
  
      Args:
        tag: string. The tag to use.
        hparams_plugin_data: The HParamsPluginData message to use.
      """
      summary = tf.compat.v1.Summary()
      tb_metadata = metadata.create_summary_metadata(
          hparams_plugin_data
      )
      raw_metadata = tb_metadata.SerializeToString()
      tf_metadata = tf.compat.v1.SummaryMetadata.FromString(
          raw_metadata
      )
      summary.value.add(
          tag=tag,
          metadata=tf_metadata,
          tensor=_TF_NULL_TENSOR,
      )
      return summary
  
file_path: tensorboard/tensorboard/plugins/hparams/summary.py
imports: import time
  import tensorflow
  from tensorboard.plugins.hparams import api_pb2
  from tensorboard.plugins.hparams import metadata
  from tensorboard.plugins.hparams import plugin_data_pb2
label_desc: Use image node_id 4 for calling a global function with example usage: _summary(tag, hparams_plugin_data) and returns: summary