code: def deploy(
      deployment_name: str,
      model_config: dict = None,
      mii_config: dict = None,
      *args,
      **kwargs,
  ):
      if mii_config is None:
          mii_config = {}
  
      if args or kwargs:
          assert (
              not model_config
          ), "We do not support mixture of legacy and new API options, use latest API."
          kwargs["mii_config"] = mii_config
          model_config, mii_config = support_legacy_api(*args, **kwargs)
  
      mii_config["deployment_name"] = deployment_name
      mii_config["model_config"] = model_config
      mii_config = mii.config.MIIConfig(**mii_config)
  
      if mii_config.model_config.enable_deepspeed:
          logger.info(
              "************* MII is using DeepSpeed Optimizations to accelerate your model *************"
          )
      else:
          logger.info(
              "************* DeepSpeed Optimizations not enabled. Please use enable_deepspeed to get better performance *************"
          )
  
      if mii_config.deployment_type != DeploymentType.NON_PERSISTENT:
          create_score_file(mii_config)
  
      if mii_config.deployment_type == DeploymentType.AML:
          _deploy_aml(mii_config)
      elif mii_config.deployment_type == DeploymentType.LOCAL:
          _deploy_local(mii_config)
      elif mii_config.deployment_type == DeploymentType.NON_PERSISTENT:
          _deploy_nonpersistent(mii_config)
  
file_path: deepspeed-mii/mii/legacy/deployment.py
imports: import os
  import mii.legacy
  from .logging import logger
  from .models.score import create_score_file
  from .models import load_models
  from .config import MIIConfig, DeploymentType
label_desc: Use image node_id 2 for calling a global function with example usage: deploy(deployment_name, model_config, mii_config) without return types