code: def test_deploy_model(
      pytorch_training_job,
      sagemaker_session,
      cpu_instance_type,
      pytorch_inference_latest_version,
      pytorch_inference_latest_py_version,
  ):
      endpoint_name = unique_name_from_base("test-pytorch-deploy-model")
  
      with timeout_and_delete_endpoint_by_name(
          endpoint_name, sagemaker_session
      ):
          desc = (
              sagemaker_session.sagemaker_client.describe_training_job(
                  TrainingJobName=pytorch_training_job
              )
          )
          model_data = desc["ModelArtifacts"]["S3ModelArtifacts"]
          model = PyTorchModel(
              model_data,
              "SageMakerRole",
              entry_point=MNIST_SCRIPT,
              framework_version=pytorch_inference_latest_version,
              py_version=pytorch_inference_latest_py_version,
              sagemaker_session=sagemaker_session,
          )
          predictor = model.deploy(
              1, cpu_instance_type, endpoint_name=endpoint_name
          )
  
          batch_size = 100
          data = numpy.random.rand(batch_size, 1, 28, 28).astype(
              numpy.float32
          )
          output = predictor.predict(data)
  
          assert output.shape == (batch_size, 10)
  
imports: from __future__ import absolute_import
  import numpy
  import os
  import pytest
  from sagemaker.pytorch.estimator import PyTorch
  from sagemaker.pytorch.model import PyTorchModel
  from sagemaker.pytorch.processing import PyTorchProcessor
  from sagemaker.serverless import ServerlessInferenceConfig
  from sagemaker.utils import unique_name_from_base
  from tests.integ import test_region, DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES, EI_SUPPORTED_REGIONS
  from tests.integ.timeout import timeout, timeout_and_delete_endpoint_by_name
label_desc: Use image node_id 7 for calling a global function with example usage: test_deploy_model(pytorch_training_job, sagemaker_session, cpu_instance_type, pytorch_inference_latest_version, pytorch_inference_latest_py_version) without return types