code: def test_transformer_creation_with_optional_args(
      create_model,
      sagemaker_session,
      tensorflow_inference_version,
      tensorflow_inference_py_version,
  ):
      if version.Version(
          tensorflow_inference_version
      ) < version.Version("1.11"):
          pytest.skip(
              "Legacy TF version requires explicit image URI, and "
              "this logic is tested in test_create_model_with_custom_image."
          )
  
      model = Mock()
      create_model.return_value = model
  
      tf = TensorFlow(
          entry_point=SCRIPT_PATH,
          framework_version=tensorflow_inference_version,
          py_version=tensorflow_inference_py_version,
          role=ROLE,
          sagemaker_session=sagemaker_session,
          instance_count=INSTANCE_COUNT,
          instance_type=INSTANCE_TYPE,
      )
      tf.latest_training_job = _TrainingJob(
          sagemaker_session, "some-job-name"
      )
  
      strategy = "SingleRecord"
      assemble_with = "Line"
      output_path = "s3://{}/batch-output".format(BUCKET_NAME)
      kms_key = "kms"
      accept_type = "text/bytes"
      env = {"foo": "bar"}
      max_concurrent_transforms = 3
      max_payload = 100
      tags = [{"Key": "foo", "Value": "bar"}]
      new_role = "role"
      vpc_config = {"Subnets": ["1234"], "SecurityGroupIds": ["5678"]}
      model_name = "model-name"
  
      tf.transformer(
          INSTANCE_COUNT,
          INSTANCE_TYPE,
          strategy=strategy,
          assemble_with=assemble_with,
          output_path=output_path,
          output_kms_key=kms_key,
          accept=accept_type,
          env=env,
          max_concurrent_transforms=max_concurrent_transforms,
          max_payload=max_payload,
          tags=tags,
          role=new_role,
          volume_kms_key=kms_key,
          entry_point=SERVING_SCRIPT_FILE,
          vpc_config_override=vpc_config,
          enable_network_isolation=True,
          model_name=model_name,
      )
  
      create_model.assert_called_with(
          role=new_role,
          vpc_config_override=vpc_config,
          entry_point=SERVING_SCRIPT_FILE,
          enable_network_isolation=True,
          name=model_name,
      )
      model.transformer.assert_called_with(
          INSTANCE_COUNT,
          INSTANCE_TYPE,
          accept=accept_type,
          assemble_with=assemble_with,
          env=env,
          max_concurrent_transforms=max_concurrent_transforms,
          max_payload=max_payload,
          output_kms_key=kms_key,
          output_path=output_path,
          strategy=strategy,
          tags=tags,
          volume_kms_key=kms_key,
      )
  
imports: from __future__ import absolute_import
  import json
  import logging
  import os
  from mock import patch, Mock, MagicMock
  from packaging import version
  import pytest
  from sagemaker.estimator import _TrainingJob
  from sagemaker.session_settings import SessionSettings
  from sagemaker.tensorflow import TensorFlow
  from sagemaker.instance_group import InstanceGroup
  from sagemaker.workflow.parameters import ParameterString, ParameterBoolean
  from tests.unit import DATA_DIR
label_desc: Use image node_id 9 for calling a global function with example usage: test_transformer_creation_with_optional_args(create_model, sagemaker_session, tensorflow_inference_version, tensorflow_inference_py_version) without return types