code: def test_model_create_transformer_optional_params(
      create_sagemaker_model, sagemaker_session
  ):
      model = Model(
          MODEL_IMAGE, MODEL_DATA, sagemaker_session=sagemaker_session
      )
  
      instance_type = "ml.m4.xlarge"
      strategy = "MultiRecord"
      assemble_with = "Line"
      output_path = "s3://bucket/path"
      kms_key = "key"
      accept = "text/csv"
      env = {"test": True}
      max_concurrent_transforms = 1
      max_payload = 6
      tags = [{"Key": "k", "Value": "v"}]
  
      transformer = model.transformer(
          instance_count=1,
          instance_type=instance_type,
          strategy=strategy,
          assemble_with=assemble_with,
          output_path=output_path,
          output_kms_key=kms_key,
          accept=accept,
          env=env,
          max_concurrent_transforms=max_concurrent_transforms,
          max_payload=max_payload,
          tags=tags,
          volume_kms_key=kms_key,
      )
  
      create_sagemaker_model.assert_called_with(
          instance_type, tags=tags
      )
  
      assert isinstance(transformer, sagemaker.transformer.Transformer)
      assert transformer.strategy == strategy
      assert transformer.assemble_with == assemble_with
      assert transformer.output_path == output_path
      assert transformer.output_kms_key == kms_key
      assert transformer.accept == accept
      assert (
          transformer.max_concurrent_transforms
          == max_concurrent_transforms
      )
      assert transformer.max_payload == max_payload
      assert transformer.env == env
      assert transformer.tags == tags
      assert transformer.volume_kms_key == kms_key
  
imports: from __future__ import absolute_import
  import random
  from unittest.mock import MagicMock
  import pytest
  from mock import Mock, patch
  import sagemaker
  from sagemaker.async_inference import AsyncInferenceConfig
  from sagemaker.model import FrameworkModel, Model
  from sagemaker.huggingface.model import HuggingFaceModel
  from sagemaker.jumpstart.constants import JUMPSTART_GATED_AND_PUBLIC_BUCKET_NAME_SET, JUMPSTART_RESOURCE_BASE_NAME
  from sagemaker.jumpstart.enums import JumpStartTag
  from sagemaker.mxnet.model import MXNetModel
  from sagemaker.pytorch.model import PyTorchModel
  from sagemaker.session_settings import SessionSettings
  from sagemaker.sklearn.model import SKLearnModel
  from sagemaker.tensorflow.model import TensorFlowModel
  from sagemaker.xgboost.model import XGBoostModel
  from sagemaker.enums import EndpointType
  from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements
  from sagemaker.workflow.properties import Properties
  from tests.unit import _test_default_bucket_and_prefix_combinations, DEFAULT_S3_BUCKET_NAME, DEFAULT_S3_OBJECT_KEY_PREFIX_NAME, SAGEMAKER_CONFIG_EDGE_PACKAGING_JOB
label_desc: Use image node_id 21 for calling a global function with example usage: test_model_create_transformer_optional_params(create_sagemaker_model, sagemaker_session) without return types