code: def get_config_for_one_model(cur_dir, name, config_filename):
      all_model_configs = {}
      all_model_versions = {}
      filename = os.path.join(cur_dir, name, config_filename)
      json_config = json.loads(pbtxt2json(open(filename).read()))
      json_config[
          "name"
      ] = name  # because name in config data may be different from model_name,
      # model_name is model directory name actually, we should conform name with model_name.
      json_config["config_filenames"] = config_filename
      all_model_configs[
          name
      ] = json_config  # store original config file content in json format
      all_model_versions[name] = {}
      for model_sub_dir in os.listdir(os.path.join(cur_dir, name)):
          if re.match(
              r"\d+", model_sub_dir
          ):  # version directory consists of numbers
              if model_sub_dir not in all_model_versions[name]:
                  all_model_versions[name][model_sub_dir] = []
              for version_resource_file in os.listdir(
                  os.path.join(cur_dir, name, model_sub_dir)
              ):
                  all_model_versions[name][model_sub_dir].append(
                      version_resource_file
                  )
      model_config = original_format_to_exchange_format(
          all_model_configs, all_model_versions
      )
      if model_config["ensembles"]:
          return model_config["ensembles"][0]
      elif model_config["models"]:
          return model_config["models"][0]
  
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 10 for calling a global function with example usage: get_config_for_one_model(cur_dir, name, config_filename) and returns: model_config, model_config