code: def test_gated_model_non_model_package_s3_uri(
      self,
      mock_estimator_deploy: mock.Mock,
      mock_estimator_fit: mock.Mock,
      mock_estimator_init: mock.Mock,
      mock_get_model_specs: mock.Mock,
      mock_session_estimator: mock.Mock,
      mock_session_model: mock.Mock,
      mock_is_valid_model_id: mock.Mock,
      mock_timestamp: mock.Mock,
      mock_get_jumpstart_gated_content_bucket: mock.Mock,
  ):
      mock_estimator_deploy.return_value = default_predictor
  
      mock_get_jumpstart_gated_content_bucket.return_value = (
          "top-secret-private-models-bucket"
      )
      mock_timestamp.return_value = "8675309"
  
      mock_is_valid_model_id.return_value = True
  
      model_id, _ = (
          "js-gated-artifact-non-model-package-trainable-model",
          "*",
      )
  
      mock_get_model_specs.side_effect = get_special_model_spec
  
      mock_session_estimator.return_value = sagemaker_session
      mock_session_model.return_value = sagemaker_session
  
      estimator = JumpStartEstimator(
          model_id=model_id, environment={"accept_eula": True}
      )
  
      mock_estimator_init.assert_called_once_with(
          instance_type="ml.g5.12xlarge",
          instance_count=1,
          image_uri="763104351884.dkr.ecr.us-west-2.amazonaws.com/huggingface-pyt"
          "orch-training:2.0.0-transformers4.28.1-gpu-py310-cu118-ubuntu20.04",
          source_dir="s3://jumpstart-cache-prod-us-west-2/source-d"
          "irectory-tarballs/meta/transfer_learning/textgeneration/prepack/v1.0.1/sourcedir.tar.gz",
          entry_point="transfer_learning.py",
          hyperparameters={
              "int8_quantization": "False",
              "enable_fsdp": "True",
              "epoch": "5",
              "learning_rate": "0.0001",
              "lora_r": "8",
              "lora_alpha": "32",
              "lora_dropout": "0.05",
              "instruction_tuned": "False",
              "chat_dataset": "False",
              "add_input_output_demarcation_key": "True",
              "per_device_train_batch_size": "4",
              "per_device_eval_batch_size": "1",
              "max_train_samples": "-1",
              "max_val_samples": "-1",
              "seed": "10",
              "max_input_length": "-1",
              "validation_split_ratio": "0.2",
              "train_data_split_seed": "0",
              "preprocessing_num_workers": "None",
          },
          metric_definitions=[
              {
                  "Name": "huggingface-textgeneration:eval-loss",
                  "Regex": "eval_epoch_loss=tensor\\(([0-9\\.]+)",
              },
              {
                  "Name": "huggingface-textgeneration:eval-ppl",
                  "Regex": "eval_ppl=tensor\\(([0-9\\.]+)",
              },
              {
                  "Name": "huggingface-textgeneration:train-loss",
                  "Regex": "train_epoch_loss=([0-9\\.]+)",
              },
          ],
          role="fake role! do not use!",
          max_run=360000,
          sagemaker_session=sagemaker_session,
          tags=[
              {
                  "Key": "sagemaker-sdk:jumpstart-model-id",
                  "Value": "js-gated-artifact-non-model-package-trainable-model",
              },
              {
                  "Key": "sagemaker-sdk:jumpstart-model-version",
                  "Value": "3.0.0",
              },
          ],
          encrypt_inter_container_traffic=True,
          enable_network_isolation=True,
          environment={
              "SELF_DESTRUCT": "true",
              "accept_eula": True,
              "SageMakerGatedModelS3Uri": "s3://top-secret-private-"
              "models-bucket/meta-training/train-meta-textgeneration-llama-2-7b.tar.gz",
          },
      )
  
      channels = {
          "training": f"s3://{get_jumpstart_content_bucket(region)}/"
          f"some-training-dataset-doesn't-matter",
      }
  
      estimator.fit(channels)
  
      mock_estimator_fit.assert_called_once_with(
          inputs=channels,
          wait=True,
          job_name="meta-textgeneration-llama-2-7b-8675309",
      )
  
      estimator.deploy()
  
      mock_estimator_deploy.assert_called_once_with(
          instance_type="ml.g5.2xlarge",
          initial_instance_count=1,
          image_uri="763104351884.dkr.ecr.us-west-2.amazonaws.com/huggingface-pytor"
          "ch-tgi-inference:2.0.1-tgi1.1.0-gpu-py39-cu118-ubuntu20.04",
          env={
              "SAGEMAKER_PROGRAM": "inference.py",
              "ENDPOINT_SERVER_TIMEOUT": "3600",
              "MODEL_CACHE_ROOT": "/opt/ml/model",
              "SAGEMAKER_ENV": "1",
              "HF_MODEL_ID": "/opt/ml/model",
              "MAX_INPUT_LENGTH": "4095",
              "MAX_TOTAL_TOKENS": "4096",
              "SM_NUM_GPUS": "1",
              "SAGEMAKER_MODEL_SERVER_WORKERS": "1",
          },
          predictor_cls=Predictor,
          endpoint_name="meta-textgeneration-llama-2-7b-8675309",
          tags=[
              {
                  "Key": "sagemaker-sdk:jumpstart-model-id",
                  "Value": "js-gated-artifact-non-model-package-trainable-model",
              },
              {
                  "Key": "sagemaker-sdk:jumpstart-model-version",
                  "Value": "3.0.0",
              },
          ],
          wait=True,
          model_data_download_timeout=1200,
          container_startup_health_check_timeout=1200,
          role="fake role! do not use!",
          enable_network_isolation=True,
          model_name="meta-textgeneration-llama-2-7b-8675309",
          use_compiled_model=False,
      )
  
imports: from __future__ import absolute_import
  import time
  from typing import Optional, Set
  from unittest import mock
  import unittest
  from inspect import signature
  import pytest
  from sagemaker.async_inference.async_inference_config import AsyncInferenceConfig
  from sagemaker.debugger.profiler_config import ProfilerConfig
  from sagemaker.estimator import Estimator
  from sagemaker.instance_group import InstanceGroup
  from sagemaker.jumpstart.artifacts.environment_variables import _retrieve_default_environment_variables
  from sagemaker.jumpstart.artifacts.hyperparameters import _retrieve_default_hyperparameters
  from sagemaker.jumpstart.artifacts.metric_definitions import _retrieve_default_training_metric_definitions
  from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION
  from sagemaker.jumpstart.enums import JumpStartScriptScope, JumpStartTag
  from sagemaker.jumpstart.estimator import JumpStartEstimator
  from sagemaker.jumpstart.utils import get_jumpstart_content_bucket
  from sagemaker.session_settings import SessionSettings
  from tests.integ.sagemaker.jumpstart.utils import get_training_dataset_for_model_and_version
  from sagemaker.model import Model
  from sagemaker.predictor import Predictor
  from tests.unit.sagemaker.jumpstart.utils import get_special_model_spec, overwrite_dictionary
label_desc: Use image node_id 4 for calling the EstimatorTest obj's underlying member method code with example usage: obj.test_gated_model_non_model_package_s3_uri(mock_estimator_deploy, mock_estimator_fit, mock_estimator_init, mock_get_model_specs, mock_session_estimator, mock_session_model, mock_is_valid_model_id, mock_timestamp, mock_get_jumpstart_gated_content_bucket) without return types