code: def test_predict_invocation_with_target_variant_local_mode(
      sagemaker_session, multi_variant_endpoint
  ):
      if sagemaker_session._region_name is None:
          sagemaker_session._region_name = DEFAULT_REGION
  
      predictor = Predictor(
          endpoint_name=multi_variant_endpoint.endpoint_name,
          sagemaker_session=sagemaker_session,
          serializer=CSVSerializer(),
          deserializer=CSVDeserializer(),
      )
  
      # Validate that no exception is raised when the target_variant is specified.
      predictor.predict(TEST_CSV_DATA, target_variant=TEST_VARIANT_1)
      predictor.predict(TEST_CSV_DATA, target_variant=TEST_VARIANT_2)
  
imports: from __future__ import absolute_import
  import json
  import math
  import os
  import pytest
  import scipy.stats
  from sagemaker import image_uris
  from sagemaker.deserializers import CSVDeserializer
  from sagemaker.s3 import S3Uploader
  from sagemaker.session import production_variant
  from sagemaker.sparkml import SparkMLModel
  from sagemaker.utils import unique_name_from_base
  from sagemaker.predictor import Predictor
  from sagemaker.serializers import CSVSerializer
  import tests.integ
label_desc: Use image node_id 7 for calling a global function with example usage: test_predict_invocation_with_target_variant_local_mode(sagemaker_session, multi_variant_endpoint) without return types