code: def migrate_event(event):
      if not event.HasField("summary"):
          return event
      old_values = event.summary.value
      new_values = [migrate_value(value) for value in old_values]
      # Optimization: Don't create a new event if there were no changes.
      if len(old_values) == len(new_values) and all(
          x is y for (x, y) in zip(old_values, new_values)
      ):
          return event
      result = event_pb2.Event()
      result.CopyFrom(event)
      del result.summary.value[:]
      result.summary.value.extend(new_values)
      return result
  
file_path: tensorboard/tensorboard/data_compat.py
imports: import numpy
  from tensorboard.compat.proto import event_pb2
  from tensorboard.compat.proto import summary_pb2
  from tensorboard.plugins.audio import metadata
  from tensorboard.plugins.histogram import metadata
  from tensorboard.plugins.image import metadata
  from tensorboard.plugins.scalar import metadata
  from tensorboard.util import tensor_util
label_desc: Use image node_id 1 for calling a global function with example usage: migrate_event(event) and returns: result, event, event