code: def exchange_format_to_original_format(exchange_format):
      """
      Change config exchange format to original format.
      """
      ensembles = []
      models = []
      all_models = {}
      if "ensembles" in exchange_format:
          ensembles = exchange_format["ensembles"]
      if "models" in exchange_format:
          models = exchange_format["models"]
      alls = ensembles + models
      for model_config in alls:
          # 1. add 'executionAccelerators' keyword
          if "optimization" in model_config:
              optimization_config = model_config["optimization"]
              del model_config["optimization"]
              model_config["optimization"] = {}
              model_config["optimization"][
                  "executionAccelerators"
              ] = optimization_config
          # 2. delete versions information
          if "versions" in model_config:
              del model_config["versions"]
          if "config_filenames" in model_config:
              del model_config["config_filenames"]
          if (
              "platform" in model_config
              and model_config["platform"] == "ensemble"
          ):  # emsemble model
              # 3. add 'ensembleScheduling' keyword
              if "step" in model_config:
                  step_configs = model_config["step"]
                  if "ensembleScheduling" not in model_config:
                      model_config["ensembleScheduling"] = {}
                  model_config["ensembleScheduling"][
                      "step"
                  ] = step_configs
                  del model_config["step"]
                  # 4. remove two virtual models(feed, fetch), and
                  #  "modelType", "inputModels", "outputModels", "inputVars", "outputVars"
                  remove_list = []
                  for model_config_in_step in step_configs:
                      if (
                          model_config_in_step["modelName"] == "feed"
                          or model_config_in_step["modelName"]
                          == "fetch"
                      ):
                          remove_list.append(model_config_in_step)
                          continue
                      del model_config_in_step["modelType"]
                      del model_config_in_step["inputModels"]
                      del model_config_in_step["outputModels"]
                      del model_config_in_step["inputVars"]
                      del model_config_in_step["outputVars"]
                  for remove_item in remove_list:
                      step_configs.remove(remove_item)
          all_models[model_config["name"]] = model_config
      return all_models
  
imports: import copy
  import json
  import os
  import random
  import re
  import signal
  import string
  from collections import defaultdict
  from subprocess import Popen
  from subprocess import STDOUT
  import google.protobuf.json_format
  import google.protobuf.text_format
  import psutil
  import requests
  from .proto.model_config_pb2 import ModelConfig
  from visualdl.utils.dir import FASTDEPLOYSERVER_PATH
label_desc: Use image node_id 5 for calling a global function with example usage: exchange_format_to_original_format(exchange_format) and returns: all_models