code: def download_pretrain_model(
      self, cur_dir, model_name, version, pretrain_model_name
  ):
      version_resource_dir = os.path.join(
          os.path.abspath(cur_dir), model_name, version
      )
      try:
          import fastdeploy as fd
      except Exception:
          raise RuntimeError(
              "fastdeploy is required for visualizing results，please refer to "
              "https://github.com/PaddlePaddle/FastDeploy to install fastdeploy"
          )
      model_path = fd.download_model(
          name=pretrain_model_name, path=version_resource_dir
      )
      if model_path:
          if ".onnx" in model_path:
              shutil.move(
                  model_path,
                  os.path.join(
                      os.path.dirname(model_path), "model.onnx"
                  ),
              )
          else:
              for filename in os.listdir(model_path):
                  if ".pdmodel" in filename or ".pdiparams" in filename:
                      shutil.move(
                          os.path.join(model_path, filename),
                          os.path.join(
                              os.path.dirname(model_path),
                              "model{}".format(
                                  os.path.splitext(filename)[1]
                              ),
                          ),
                      )
                  else:
                      shutil.move(
                          os.path.join(model_path, filename),
                          os.path.join(
                              os.path.dirname(model_path), filename
                          ),
                      )
              shutil.rmtree(model_path)
          version_info_for_frontend = []
          for version_name in os.listdir(
              os.path.join(cur_dir, model_name)
          ):
              if re.match(
                  r"\d+", version_name
              ):  # version directory consists of numbers
                  version_filenames_dict_for_frontend = {}
                  version_filenames_dict_for_frontend[
                      "title"
                  ] = version_name
                  version_filenames_dict_for_frontend[
                      "key"
                  ] = version_name
                  version_filenames_dict_for_frontend["children"] = []
                  for filename in os.listdir(
                      os.path.join(cur_dir, model_name, version_name)
                  ):
                      version_filenames_dict_for_frontend[
                          "children"
                      ].append({"title": filename, "key": filename})
                  version_info_for_frontend.append(
                      version_filenames_dict_for_frontend
                  )
          return version_info_for_frontend
      else:
          raise RuntimeError(
              "Failed to download pre-trained model {}.".format(
                  pretrain_model_name
              )
          )
  
imports: import datetime
  import json
  import os
  import re
  import shutil
  import socket
  import time
  from multiprocessing import Process
  from pathlib import Path
  import requests
  from .fastdeploy_client.client_app import create_gradio_client_app
  from .fastdeploy_client.client_app import create_gradio_client_app_en
  from .fastdeploy_lib import analyse_config
  from .fastdeploy_lib import check_process_zombie
  from .fastdeploy_lib import copy_config_file_to_default_config
  from .fastdeploy_lib import delete_files_for_process
  from .fastdeploy_lib import exchange_format_to_original_format
  from .fastdeploy_lib import generate_metric_table
  from .fastdeploy_lib import get_alive_fastdeploy_servers
  from .fastdeploy_lib import get_config_filenames_for_one_model
  from .fastdeploy_lib import get_config_for_one_model
  from .fastdeploy_lib import get_process_model_configuration
  from .fastdeploy_lib import get_process_output
  from .fastdeploy_lib import get_start_arguments
  from .fastdeploy_lib import json2pbtxt
  from .fastdeploy_lib import kill_process
  from .fastdeploy_lib import launch_process
  from .fastdeploy_lib import mark_pid_for_dead_process
  from .fastdeploy_lib import original_format_to_exchange_format
  from .fastdeploy_lib import validate_data
  from visualdl.server.api import gen_result
  from visualdl.server.api import result
  from visualdl.utils.dir import FASTDEPLOYSERVER_PATH
label_desc: Use image node_id 13 for calling the FastDeployServerApi obj's underlying member method code with example usage: obj.download_pretrain_model(cur_dir, model_name, version, pretrain_model_name) and returns: version_info_for_frontend