class_docstr: Tests for `migrate_event`.
class_docstr_tok: ["Tests","for","`","migrate_event","`","."]
docstr: Like `migrate_event`, but performs some sanity checks.
docstr_tok: ["Like","`","migrate_event","`",",","but","performs","some","sanity","checks","."]
code: def _migrate_event(self, old_event, initial_metadata=None):
      """Like `migrate_event`, but performs some sanity checks."""
      if initial_metadata is None:
          initial_metadata = {}
      old_event_copy = event_pb2.Event()
      old_event_copy.CopyFrom(old_event)
      new_events = dataclass_compat.migrate_event(
          old_event, initial_metadata=initial_metadata
      )
      for (
          event
      ) in new_events:  # ensure that wall time and step are preserved
          self.assertEqual(event.wall_time, old_event.wall_time)
          self.assertEqual(event.step, old_event.step)
      return new_events
  
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 1 for calling the MigrateEventTest obj's underlying member method code with example usage: obj._migrate_event(old_event, initial_metadata) and returns: new_events