code: def get_model_package_arn_from_static_pipeline(
      pipeline_execution_arn, sagemaker_session
  ):
      # get the model package ARN from the pipeline
      pipeline_execution_steps = sagemaker_session.sagemaker_client.list_pipeline_execution_steps(
          PipelineExecutionArn=pipeline_execution_arn
      )[
          "PipelineExecutionSteps"
      ]
  
      model_package_arn = None
      for step in pipeline_execution_steps:
          if "RegisterModel" in step["Metadata"]:
              model_package_arn = step["Metadata"]["RegisterModel"][
                  "Arn"
              ]
  
      if model_package_arn is None:
          raise (
              Exception(
                  f"Did not find a model package ARN in static pipeline execution {pipeline_execution_arn}"
              )
          )
  
      return model_package_arn
  
imports: from __future__ import absolute_import
  import time
  import boto3
  import pytest
  import logging
  import uuid
  import json
  from sagemaker.lineage import action, context, association, artifact
  from sagemaker.model import ModelPackage
  from sagemaker.utils import retry_with_backoff
  from tests.integ.sagemaker.workflow.test_workflow import test_end_to_end_pipeline_successful_execution
  from sagemaker.workflow.pipeline import _PipelineExecution
  from sagemaker.session import get_execution_role
  from smexperiments import trial_component, trial, experiment
  from random import randint
  from botocore.exceptions import ClientError
  from sagemaker.lineage.query import LineageQuery, LineageFilter, LineageSourceEnum, LineageEntityEnum, LineageQueryDirectionEnum
  from sagemaker.lineage.lineage_trial_component import LineageTrialComponent
  from tests.integ.sagemaker.lineage.helpers import name, names
label_desc: Use image node_id 40 for calling a global function with example usage: get_model_package_arn_from_static_pipeline(pipeline_execution_arn, sagemaker_session) and returns: model_package_arn