code: def deployment(
      deployment_name, mii_config, model_config, expected_failure
  ):
      if expected_failure is not None:
          with pytest.raises(expected_failure) as excinfo:
              mii.deploy(
                  deployment_name=deployment_name,
                  mii_config=mii_config,
                  model_config=model_config,
              )
          yield excinfo
      else:
          mii.deploy(
              deployment_name=deployment_name,
              mii_config=mii_config,
              model_config=model_config,
          )
          yield deployment_name
          mii.terminate(deployment_name)
  
imports: import pytest
  import os
  import mii.legacy
  from types import SimpleNamespace
label_desc: Use image node_id 20 for calling a global function with example usage: deployment(deployment_name, mii_config, model_config, expected_failure) without return types