code: def test_create_model_with_network_isolation(
      upload, sagemaker_session, sklearn_version
  ):
      source_dir = "s3://mybucket/source"
      repacked_model_data = "s3://mybucket/prefix/model.tar.gz"
  
      sklearn_model = SKLearnModel(
          model_data=source_dir,
          role=ROLE,
          sagemaker_session=sagemaker_session,
          entry_point=SCRIPT_PATH,
          enable_network_isolation=True,
          framework_version=sklearn_version,
      )
      sklearn_model.uploaded_code = UploadedCode(
          s3_prefix=repacked_model_data, script_name="script"
      )
      sklearn_model.repacked_model_data = repacked_model_data
      model_values = sklearn_model.prepare_container_def(CPU)
      assert (
          model_values["Environment"]["SAGEMAKER_SUBMIT_DIRECTORY"]
          == "/opt/ml/model/code"
      )
      assert model_values["ModelDataUrl"] == repacked_model_data
  
imports: from __future__ import absolute_import
  import logging
  import json
  import os
  import pytest
  from mock import Mock
  from mock import patch
  from sagemaker.fw_utils import UploadedCode
  from sagemaker.session_settings import SessionSettings
  from sagemaker.sklearn import SKLearn, SKLearnModel, SKLearnPredictor
label_desc: Use image node_id 7 for calling a global function with example usage: test_create_model_with_network_isolation(upload, sagemaker_session, sklearn_version) without return types