class_docstr: Tests for `migrate_event`.
class_docstr_tok: ["Tests","for","`","migrate_event","`","."]
code: def test_doesnt_add_metadata_to_later_steps(self):
      old_events = []
      for step in range(3):
          e = event_pb2.Event()
          e.step = step
          summary = scalar_summary.pb("foo", 0.125)
          if step > 0:
              for v in summary.value:
                  v.ClearField("metadata")
          e.summary.ParseFromString(summary.SerializeToString())
          old_events.append(e)
  
      initial_metadata = {}
      new_events = []
      for e in old_events:
          migrated = self._migrate_event(
              e, initial_metadata=initial_metadata
          )
          new_events.extend(migrated)
  
      self.assertLen(new_events, len(old_events))
      self.assertEqual(
          {
              e.step
              for e in new_events
              for v in e.summary.value
              if v.HasField("metadata")
          },
          {0},
      )
  
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 5 for calling the MigrateEventTest obj's underlying member method code with example usage: obj.test_doesnt_add_metadata_to_later_steps() without return types