class_docstr: Tests for `migrate_event`.
class_docstr_tok: ["Tests","for","`","migrate_event","`","."]
code: def test_run_metadata(self):
      old_event = event_pb2.Event()
      old_event.step = 123
      old_event.wall_time = 456.75
      rm = tf.compat.v1.RunMetadata()
      rm.step_stats.dev_stats.add(device="CPU:0")
      rm.step_stats.dev_stats.add(device="CPU:1")
      old_event.tagged_run_metadata.tag = "step0"
      old_event.tagged_run_metadata.run_metadata = (
          rm.SerializeToString()
      )
  
      new_events = self._migrate_event(old_event)
      self.assertLen(new_events, 1)
      self.assertLen(new_events[0].summary.value, 1)
      value = new_events[0].summary.value[0]
      tensor = tensor_util.make_ndarray(value.tensor)
      self.assertEqual(tensor.shape, (1,))
      self.assertEqual(tensor.item(), rm.SerializeToString())
      self.assertEqual(
          value.metadata.data_class,
          summary_pb2.DATA_CLASS_BLOB_SEQUENCE,
      )
      self.assertEqual(
          value.metadata.plugin_data.plugin_name,
          graphs_metadata.PLUGIN_NAME_TAGGED_RUN_METADATA,
      )
  
imports: import os
  import numpy
  import tensorflow
  from tensorboard import dataclass_compat
  from tensorboard.backend.event_processing import event_file_loader
  from tensorboard.compat.proto import event_pb2
  from tensorboard.compat.proto import graph_pb2
  from tensorboard.compat.proto import summary_pb2
  from tensorboard.plugins.audio import metadata
  from tensorboard.plugins.audio import summary
  from tensorboard.plugins.graph import metadata
  from tensorboard.plugins.histogram import metadata
  from tensorboard.plugins.histogram import summary
  from tensorboard.plugins.hparams import metadata
  from tensorboard.plugins.hparams import summary_v2
  from tensorboard.plugins.pr_curve import metadata
  from tensorboard.plugins.pr_curve import summary
  from tensorboard.plugins.scalar import metadata
  from tensorboard.plugins.scalar import summary
  from tensorboard.util import tensor_util
  from tensorboard.util import test_util
label_desc: Use image node_id 12 for calling the MigrateEventTest obj's underlying member method code with example usage: obj.test_run_metadata() without return types