code: def _retrieve_model_package_model_artifact_s3_uri(
      model_id: str,
      model_version: str,
      region: Optional[str],
      scope: Optional[str] = None,
      tolerate_vulnerable_model: bool = False,
      tolerate_deprecated_model: bool = False,
      sagemaker_session: Session = DEFAULT_JUMPSTART_SAGEMAKER_SESSION,
  ) -> Optional[str]:
      """Retrieves s3 artifact uri associated with model package.
  
      Args:
          model_id (str): JumpStart model ID of the JumpStart model for which to
              retrieve the model package artifact.
          model_version (str): Version of the JumpStart model for which to retrieve the
              model package artifact.
          region (Optional[str]): Region for which to retrieve the model package artifact.
              (Default: None).
          scope (Optional[str]): Scope for which to retrieve the model package artifact.
              (Default: None).
          tolerate_vulnerable_model (bool): True if vulnerable versions of model
              specifications should be tolerated (exception not raised). If False, raises an
              exception if the script used by this version of the model has dependencies with known
              security vulnerabilities. (Default: False).
          tolerate_deprecated_model (bool): True if deprecated versions of model
              specifications should be tolerated (exception not raised). If False, raises
              an exception if the version of the model is deprecated. (Default: False).
          sagemaker_session (sagemaker.session.Session): A SageMaker Session
              object, used for SageMaker interactions. If not
              specified, one is created using the default AWS configuration
              chain. (Default: sagemaker.jumpstart.constants.DEFAULT_JUMPSTART_SAGEMAKER_SESSION).
      Returns:
          str: the model package artifact uri to use for the model or None.
  
      Raises:
          NotImplementedError: If an unsupported script is used.
      """
  
      if scope == JumpStartScriptScope.TRAINING:
          if region is None:
              region = JUMPSTART_DEFAULT_REGION_NAME
  
          model_specs = verify_model_region_and_return_specs(
              model_id=model_id,
              version=model_version,
              scope=scope,
              region=region,
              tolerate_vulnerable_model=tolerate_vulnerable_model,
              tolerate_deprecated_model=tolerate_deprecated_model,
              sagemaker_session=sagemaker_session,
          )
  
          if model_specs.training_model_package_artifact_uris is None:
              return None
  
          model_s3_uri = (
              model_specs.training_model_package_artifact_uris.get(
                  region
              )
          )
  
          if model_s3_uri is None:
              raise ValueError(
                  f"Model package artifact s3 uri for '{model_id}' not supported in {region}. "
                  "Please try one of the following regions: "
                  f"{', '.join(model_specs.training_model_package_artifact_uris.keys())}."
              )
  
          return model_s3_uri
  
      raise NotImplementedError(
          f"Model Package Artifact URI not supported for scope: '{scope}'"
      )
  
imports: from __future__ import absolute_import
  from typing import Optional
  from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION, JUMPSTART_DEFAULT_REGION_NAME
  from sagemaker.jumpstart.utils import verify_model_region_and_return_specs
  from sagemaker.jumpstart.enums import JumpStartScriptScope
  from sagemaker.session import Session
label_desc: Use image node_id 2 for calling a global function with example usage: _retrieve_model_package_model_artifact_s3_uri(model_id, model_version, region, scope, tolerate_vulnerable_model, tolerate_deprecated_model, sagemaker_session) and returns: model_s3_uri, None