docstr: Set up runs, then fetch and return the graph as a proto.
docstr_tok: ["Set","up","runs",",","then","fetch","and","return","the","graph","as","a","proto","."]
code: def _get_graph(self, plugin, run=None, **kwargs):
      """Set up runs, then fetch and return the graph as a proto."""
      (graph_pbtxt, mime_type) = plugin.graph_impl(
          context.RequestContext(),
          run if run is not None else _RUN_WITH_GRAPH_WITH_METADATA[0],
          **kwargs,
      )
      self.assertEqual(mime_type, "text/x-protobuf")
      return text_format.Parse(graph_pbtxt, tf.compat.v1.GraphDef())
  
imports: import collections.abc
  import math
  import os.path
  import tensorflow
  from google.protobuf import text_format
  from tensorboard import context
  from tensorboard import errors
  from tensorboard.backend.event_processing import data_provider
  from tensorboard.backend.event_processing import plugin_event_multiplexer
  from tensorboard.compat.proto import config_pb2
  from tensorboard.plugins import base_plugin
  from tensorboard.plugins.graph import graphs_plugin
  from tensorboard.util import test_util
label_desc: Use image node_id 2 for calling the GraphsPluginV1Test obj's underlying member method code with example usage: obj._get_graph(plugin, run) and returns: text_format