code: def _write_summary(name, pb):
      """Write a summary, returning the writing op.
  
      Args:
        name: As passed to `summary_scope`.
        pb: A `summary_pb2.Summary` message.
  
      Returns:
        A tensor whose value is `True` on success, or `False` if no summary
        was written because no default summary writer was available.
      """
      raw_pb = pb.SerializeToString()
      summary_scope = (
          getattr(tf.summary.experimental, "summary_scope", None)
          or tf.summary.summary_scope
      )
      with summary_scope(name):
          return tf.summary.experimental.write_raw_pb(raw_pb, step=0)
  
imports: import abc
  import hashlib
  import json
  import random
  import time
  import numpy
  from tensorboard.compat import tf2
  from tensorboard.compat.proto import summary_pb2
  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 8 for calling a global function with example usage: _write_summary(name, pb) and returns: tf