code: def get_model_config(type, version, model_type, lang):
      if type == "OCR":
          DEFAULT_MODEL_VERSION = DEFAULT_OCR_MODEL_VERSION
      elif type == "STRUCTURE":
          DEFAULT_MODEL_VERSION = DEFAULT_STRUCTURE_MODEL_VERSION
      else:
          raise NotImplementedError
  
      model_urls = MODEL_URLS[type]
      if version not in model_urls:
          version = DEFAULT_MODEL_VERSION
      if model_type not in model_urls[version]:
          if model_type in model_urls[DEFAULT_MODEL_VERSION]:
              version = DEFAULT_MODEL_VERSION
          else:
              logger.error(
                  "{} models is not support, we only support {}".format(
                      model_type,
                      model_urls[DEFAULT_MODEL_VERSION].keys(),
                  )
              )
              sys.exit(-1)
  
      if lang not in model_urls[version][model_type]:
          if lang in model_urls[DEFAULT_MODEL_VERSION][model_type]:
              version = DEFAULT_MODEL_VERSION
          else:
              logger.error(
                  "lang {} is not support, we only support {} for {} models".format(
                      lang,
                      model_urls[DEFAULT_MODEL_VERSION][
                          model_type
                      ].keys(),
                      model_type,
                  )
              )
              sys.exit(-1)
      return model_urls[version][model_type][lang]
  
imports: import os
  import sys
  import importlib
  import paddle
  import cv2
  import logging
  import numpy
  from pathlib import Path
  import base64
  from io import BytesIO
  from PIL import Image
  from ppocr.utils.logging import get_logger
  from tools.infer import predict_system
  from ppocr.utils.utility import check_and_read, get_image_file_list, alpha_to_color, binarize_img
  from ppocr.utils.network import maybe_download, download_with_progressbar, is_link, confirm_model_dir_url
  from tools.infer.utility import draw_ocr, str2bool, check_gpu
  from ppstructure.utility import init_args, draw_structure_result
  from ppstructure.predict_system import StructureSystem, save_structure_res, to_excel
label_desc: Use image node_id 4 for calling a global function with example usage: get_model_config(type, version, model_type, lang) and returns: model_urls