code: def test_pipeline_model_with_config_injection(
      tfo, time, sagemaker_session
  ):
      combined_config = copy.deepcopy(SAGEMAKER_CONFIG_MODEL)
      endpoint_config = copy.deepcopy(SAGEMAKER_CONFIG_ENDPOINT_CONFIG)
      merge_dicts(combined_config, endpoint_config)
      sagemaker_session.sagemaker_config = combined_config
  
      sagemaker_session.create_model = Mock()
      sagemaker_session.endpoint_from_production_variants = Mock()
  
      expected_role_arn = SAGEMAKER_CONFIG_MODEL["SageMaker"]["Model"][
          "ExecutionRoleArn"
      ]
      expected_enable_network_isolation = SAGEMAKER_CONFIG_MODEL[
          "SageMaker"
      ]["Model"]["EnableNetworkIsolation"]
      expected_vpc_config = SAGEMAKER_CONFIG_MODEL["SageMaker"][
          "Model"
      ]["VpcConfig"]
      expected_kms_key_id = SAGEMAKER_CONFIG_ENDPOINT_CONFIG[
          "SageMaker"
      ]["EndpointConfig"]["KmsKeyId"]
  
      framework_model = DummyFrameworkModel(sagemaker_session)
      sparkml_model = SparkMLModel(
          model_data=MODEL_DATA_2,
          role=ROLE,
          sagemaker_session=sagemaker_session,
      )
      pipeline_model = PipelineModel(
          [framework_model, sparkml_model],
          sagemaker_session=sagemaker_session,
      )
      assert pipeline_model.role == expected_role_arn
      assert pipeline_model.vpc_config == expected_vpc_config
      assert (
          pipeline_model.enable_network_isolation
          == expected_enable_network_isolation
      )
  
      pipeline_model.deploy(
          instance_type=INSTANCE_TYPE, initial_instance_count=1
      )
  
      sagemaker_session.create_model.assert_called_with(
          ANY,
          expected_role_arn,
          ANY,
          vpc_config=expected_vpc_config,
          enable_network_isolation=expected_enable_network_isolation,
      )
      sagemaker_session.endpoint_from_production_variants.assert_called_with(
          name="mi-1-2017-10-10-14-14-15",
          production_variants=[
              {
                  "InitialVariantWeight": 1,
                  "ModelName": "mi-1-2017-10-10-14-14-15",
                  "InstanceType": INSTANCE_TYPE,
                  "InitialInstanceCount": 1,
                  "VariantName": "AllTraffic",
              }
          ],
          tags=None,
          kms_key=expected_kms_key_id,
          wait=True,
          data_capture_config_dict=None,
      )
  
imports: from __future__ import absolute_import
  import copy
  import pytest
  from botocore.utils import merge_dicts
  from mock import Mock, patch
  from mock.mock import ANY
  from sagemaker.model import FrameworkModel
  from sagemaker.pipeline import PipelineModel
  from sagemaker.predictor import Predictor
  from sagemaker.session_settings import SessionSettings
  from sagemaker.sparkml import SparkMLModel
  from tests.unit import SAGEMAKER_CONFIG_MODEL, SAGEMAKER_CONFIG_ENDPOINT_CONFIG
label_desc: Use image node_id 9 for calling a global function with example usage: test_pipeline_model_with_config_injection(tfo, time, sagemaker_session) without return types