def MigrateBackward(self, client, message, callback):
    def _ReplaceEpisodeWithEvent(key, value):
      if RenameEventMigrator._EVENT_TO_EPISODE.has_key(key):
        raise BadMessageException('Event fields should not appear in newer messages.')
      event = RenameEventMigrator._EPISODE_TO_EVENT.get(key, None)
      return (event, value) if event else None

    message.Visit(_ReplaceEpisodeWithEvent)
    callback()
Visit all fields in the message and replace episode fields with event fields.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/base/message.py/RenameEventMigrator.MigrateBackward