code: def test_deploy(sagemaker_session, tf_version):
      estimator = MXNet(
          entry_point=SCRIPT,
          source_dir=SOURCE_DIR,
          role=ROLE,
          framework_version=tf_version,
          train_instance_count=2,
          train_instance_type=INSTANCE_TYPE_GPU,
          sagemaker_session=sagemaker_session,
          base_job_name="test-cifar",
      )
  
      estimator.fit("s3://mybucket/train")
      print(
          "job succeeded: {}".format(estimator.latest_training_job.name)
      )
  
      estimator.deploy(
          initial_instance_count=1, instance_type=INSTANCE_TYPE_CPU
      )
      image = IMAGE_URI_FORMAT_STRING.format(
          REGION, CPU_IMAGE_NAME, tf_version, "cpu", "py2"
      )
      sagemaker_session.create_model.assert_called_with(
          estimator._current_job_name,
          ROLE,
          {
              "Environment": {
                  "SAGEMAKER_CONTAINER_LOG_LEVEL": "20",
                  "SAGEMAKER_SUBMIT_DIRECTORY": SOURCE_DIR,
                  "SAGEMAKER_REGION": REGION,
                  "SAGEMAKER_PROGRAM": SCRIPT,
              },
              "Image": image,
              "ModelDataUrl": "s3://m/m.tar.gz",
          },
      )
  
imports: from __future__ import absolute_import
  import pytest
  from mock import Mock
  from sagemaker.mxnet import MXNet
label_desc: Use image node_id 2 for calling a global function with example usage: test_deploy(sagemaker_session, tf_version) without return types