code: def predictor(sagemaker_session, tensorflow_inference_latest_version):
      endpoint_name = unique_name_from_base(
          "sagemaker-tensorflow-serving"
      )
      model_data = sagemaker_session.upload_data(
          path=os.path.join(
              tests.integ.DATA_DIR,
              "tensorflow-serving-test-model.tar.gz",
          ),
          key_prefix="tensorflow-serving/models",
      )
      with tests.integ.timeout.timeout_and_delete_endpoint_by_name(
          endpoint_name=endpoint_name,
          sagemaker_session=sagemaker_session,
          hours=2,
          sleep_between_cleanup_attempts=20,
          exponential_sleep=True,
      ):
          model = TensorFlowModel(
              model_data=model_data,
              role=ROLE,
              framework_version=tensorflow_inference_latest_version,
              sagemaker_session=sagemaker_session,
          )
          predictor = model.deploy(
              INSTANCE_COUNT,
              INSTANCE_TYPE,
              endpoint_name=endpoint_name,
              data_capture_config=DataCaptureConfig(
                  True, sagemaker_session=sagemaker_session
              ),
          )
          yield predictor
  
imports: from __future__ import absolute_import
  import json
  import os
  import uuid
  import time
  import pytest
  import tests.integ
  import tests.integ.timeout
  from sagemaker.s3 import S3Uploader
  from datetime import datetime, timedelta
  from tests.integ import DATA_DIR
  from sagemaker.model_monitor import DatasetFormat
  from sagemaker.model_monitor import MonitoringDatasetFormat
  from sagemaker.model_monitor import NetworkConfig, Statistics, Constraints
  from sagemaker.model_monitor import ModelMonitor
  from sagemaker.model_monitor import DefaultModelMonitor
  from sagemaker.model_monitor import MonitoringOutput
  from sagemaker.model_monitor import DataCaptureConfig
  from sagemaker.model_monitor import BatchTransformInput
  from sagemaker.model_monitor import DataQualityMonitoringConfig
  from sagemaker.model_monitor import DataQualityDistributionConstraints
  from sagemaker.model_monitor.data_capture_config import _MODEL_MONITOR_S3_PATH
  from sagemaker.model_monitor.data_capture_config import _DATA_CAPTURE_S3_PATH
  from sagemaker.model_monitor import CronExpressionGenerator
  from sagemaker.model_monitor.monitoring_alert import MonitoringAlertSummary
  from sagemaker.processing import ProcessingInput
  from sagemaker.processing import ProcessingOutput
  from sagemaker.tensorflow.model import TensorFlowModel
  from sagemaker.utils import unique_name_from_base
  from tests.integ.kms_utils import get_or_create_kms_key
  from tests.integ.retry import retries
label_desc: Use image node_id 1 for calling a global function with example usage: predictor(sagemaker_session, tensorflow_inference_latest_version) without return types