code: def test_gated_model_training_v1(setup):
      model_id = "meta-textgeneration-llama-2-7b"
      model_version = (
          "2.*"  # model artifacts were retrieved using legacy workflow
      )
  
      estimator = JumpStartEstimator(
          model_id=model_id,
          model_version=model_version,
          role=get_sm_session().get_caller_identity_arn(),
          sagemaker_session=get_sm_session(),
          tags=[
              {
                  "Key": JUMPSTART_TAG,
                  "Value": os.environ[
                      ENV_VAR_JUMPSTART_SDK_TEST_SUITE_ID
                  ],
              }
          ],
          environment={"accept_eula": "true"},
          max_run=259200,  # avoid exceeding resource limits
      )
  
      # uses ml.g5.12xlarge instance
      estimator.fit(
          {
              "training": f"s3://{get_jumpstart_content_bucket(JUMPSTART_DEFAULT_REGION_NAME)}/"
              f"{get_training_dataset_for_model_and_version(model_id, model_version)}",
          }
      )
  
      # uses ml.g5.2xlarge instance
      predictor = estimator.deploy(
          tags=[
              {
                  "Key": JUMPSTART_TAG,
                  "Value": os.environ[
                      ENV_VAR_JUMPSTART_SDK_TEST_SUITE_ID
                  ],
              }
          ],
          role=get_sm_session().get_caller_identity_arn(),
          sagemaker_session=get_sm_session(),
      )
  
      payload = {
          "inputs": "some-payload",
          "parameters": {
              "max_new_tokens": 256,
              "top_p": 0.9,
              "temperature": 0.6,
          },
      }
  
      response = predictor.predict(
          payload, custom_attributes="accept_eula=true"
      )
  
      assert response is not None
  
file_path: sagemaker-python-sdk/tests/integ/sagemaker/jumpstart/estimator/test_jumpstart_estimator.py
imports: from __future__ import absolute_import
  import os
  import time
  import mock
  import pytest
  from sagemaker.jumpstart.constants import JUMPSTART_DEFAULT_REGION_NAME
  from sagemaker.jumpstart.estimator import JumpStartEstimator
  import tests
  from tests.integ.sagemaker.jumpstart.constants import ENV_VAR_JUMPSTART_SDK_TEST_SUITE_ID, JUMPSTART_TAG
  from tests.integ.sagemaker.jumpstart.utils import get_sm_session, get_training_dataset_for_model_and_version, x_fail_if_ice
  from sagemaker.jumpstart.utils import get_jumpstart_content_bucket
label_desc: Use image node_id 2 for calling a global function with example usage: test_gated_model_training_v1(setup) without return types