code: def pb(
      name,
      vertices,
      faces=None,
      colors=None,
      display_name=None,
      description=None,
      config_dict=None,
  ):
      """Create a mesh summary to save in pb format.
  
      DEPRECATED: see `summary_v2.py` instead.
  
      Args:
        name: A name for this summary operation.
        vertices: numpy array of shape `[dim_1, ..., dim_n, 3]` representing the 3D
          coordinates of vertices.
        faces: numpy array of shape `[dim_1, ..., dim_n, 3]` containing indices of
          vertices within each triangle.
        colors: numpy array of shape `[dim_1, ..., dim_n, 3]` containing colors for
          each vertex.
        display_name: If set, will be used as the display name in TensorBoard.
          Defaults to `name`.
        description: A longform readable description of the summary data. Markdown
          is supported.
        config_dict: Dictionary with ThreeJS classes names and configuration.
  
      Returns:
        Instance of tf.Summary class.
      """
      display_name = _get_display_name(name, display_name)
      json_config = _get_json_config(config_dict)
  
      summaries = []
      tensors = [
          metadata.MeshTensor(
              vertices,
              plugin_data_pb2.MeshPluginData.VERTEX,
              tf.float32,
          ),
          metadata.MeshTensor(
              faces, plugin_data_pb2.MeshPluginData.FACE, tf.int32
          ),
          metadata.MeshTensor(
              colors, plugin_data_pb2.MeshPluginData.COLOR, tf.uint8
          ),
      ]
      tensors = [
          tensor for tensor in tensors if tensor.data is not None
      ]
      components = metadata.get_components_bitmask(
          [tensor.content_type for tensor in tensors]
      )
      for tensor in tensors:
          shape = tensor.data.shape
          shape = [dim if dim is not None else -1 for dim in shape]
          tensor_proto = tf.compat.v1.make_tensor_proto(
              tensor.data, dtype=tensor.data_type
          )
          summary_metadata = metadata.create_summary_metadata(
              name,
              display_name,
              tensor.content_type,
              components,
              shape,
              description,
              json_config=json_config,
          )
          tag = metadata.get_instance_name(name, tensor.content_type)
          summaries.append((tag, summary_metadata, tensor_proto))
  
      summary = tf.compat.v1.Summary()
      for tag, summary_metadata, tensor_proto in summaries:
          tf_summary_metadata = tf.compat.v1.SummaryMetadata.FromString(
              summary_metadata.SerializeToString()
          )
          summary.value.add(
              tag=tag, metadata=tf_summary_metadata, tensor=tensor_proto
          )
      return summary
  
file_path: tensorboard/tensorboard/plugins/mesh/summary.py
imports: import json
  import tensorflow
  from tensorboard.plugins.mesh import metadata
  from tensorboard.plugins.mesh import plugin_data_pb2
  from tensorboard.plugins.mesh import summary_v2
label_desc: Use image node_id 5 for calling a global function with example usage: pb(name, vertices, faces, colors, display_name, description, config_dict) and returns: summary