code: def _deploy_and_predict(
      sagemaker_session, tuner, data_set, cpu_instance_type
  ):
      best_training_job = tuner.best_training_job()
      with timeout_and_delete_endpoint_by_name(
          best_training_job, sagemaker_session
      ):
          print(
              "Deploying best model of hyperparameter tuning job {}: {}".format(
                  tuner.latest_tuning_job.name, best_training_job
              )
          )
          predictor = tuner.deploy(
              1,
              cpu_instance_type,
              endpoint_name=best_training_job,
              serializer=PredictionDataSerializer(),
              deserializer=JSONDeserializer(),
          )
  
          print("Making prediction using the deployed model")
          data = data_set[0][:10]
          result = predictor.predict(data)
  
          assert len(result["predictions"]) == len(data)
          for prediction in result["predictions"]:
              assert prediction is not None
  
imports: from __future__ import absolute_import
  import json
  import os
  import pytest
  from sagemaker import image_uris, utils
  from sagemaker.analytics import HyperparameterTuningJobAnalytics
  from sagemaker.deserializers import JSONDeserializer
  from sagemaker.estimator import Estimator
  from sagemaker.serializers import SimpleBaseSerializer
  from sagemaker.tuner import ContinuousParameter, IntegerParameter, HyperparameterTuner
  from tests.integ import datasets, DATA_DIR, TUNING_DEFAULT_TIMEOUT_MINUTES
  from tests.integ.timeout import timeout, timeout_and_delete_endpoint_by_name
label_desc: Use image node_id 11 for calling a global function with example usage: _deploy_and_predict(sagemaker_session, tuner, data_set, cpu_instance_type) without return types