code: def text(tag, text):
      import json
  
      PluginData = SummaryMetadata.PluginData(
          plugin_name="text",
          content=TextPluginData(version=0).SerializeToString(),
      )
      smd = SummaryMetadata(plugin_data=PluginData)
      tensor = TensorProto(
          dtype="DT_STRING",
          string_val=[text.encode(encoding="utf_8")],
          tensor_shape=TensorShapeProto(
              dim=[TensorShapeProto.Dim(size=1)]
          ),
      )
      return Summary(
          value=[
              Summary.Value(
                  tag=tag + "/text_summary", metadata=smd, tensor=tensor
              )
          ]
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import numpy
  import os
  import re
  from .proto.summary_pb2 import Summary
  from .proto.summary_pb2 import HistogramProto
  from .proto.summary_pb2 import SummaryMetadata
  from .proto.tensor_pb2 import TensorProto
  from .proto.tensor_shape_pb2 import TensorShapeProto
  from .proto.plugin_pr_curve_pb2 import PrCurvePluginData
  from .proto.plugin_text_pb2 import TextPluginData
  from .proto.plugin_mesh_pb2 import MeshPluginData
  from .proto import layout_pb2
  from .x2num import make_np
  from .utils import _prepare_video, convert_to_HWC, convert_to_NTCHW
label_desc: Use image node_id 16 for calling a global function with example usage: text(tag, text) and returns: Summary