code: def _get_static_pipeline_execution_arn(sagemaker_session):
      pipeline_execution_arn = None
      while pipeline_execution_arn is None:
          time.sleep(randint(2, 5))
          pipeline_executions = sagemaker_session.sagemaker_client.list_pipeline_executions(
              PipelineName=STATIC_PIPELINE_NAME,
              SortBy="CreationTime",
              SortOrder="Ascending",
          )
  
          for pipeline_execution in pipeline_executions[
              "PipelineExecutionSummaries"
          ]:
              if (
                  pipeline_execution["PipelineExecutionStatus"]
                  == "Succeeded"
              ):
                  pipeline_execution_arn = pipeline_execution[
                      "PipelineExecutionArn"
                  ]
              elif (
                  pipeline_execution["PipelineExecutionStatus"]
                  == "Executing"
              ):
                  # wait on the execution to finish
                  _PipelineExecution(
                      arn=pipeline_execution["PipelineExecutionArn"],
                      sagemaker_session=sagemaker_session,
                  ).wait()
                  pipeline_execution_arn = pipeline_execution[
                      "PipelineExecutionArn"
                  ]
  
          _deploy_static_endpoint(
              execution_arn=pipeline_execution_arn,
              sagemaker_session=sagemaker_session,
          )
      logging.info(f"Using static pipeline {pipeline_execution_arn}")
      return pipeline_execution_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 27 for calling a global function with example usage: _get_static_pipeline_execution_arn(sagemaker_session) and returns: pipeline_execution_arn