code: def static_pipeline_execution_arn(sagemaker_session):
      # Lineage query tests require several SageMaker resources
      # and their auto-created lineage entities. This method
      # looks for and returns a successful pipeline execution
      # for a static pipeline. If one doesn't exist, it starts
      # an execution and waits for it. This execution takes
      # approximately 25 minutes to run.
      try:
          sagemaker_session.sagemaker_client.describe_pipeline(
              PipelineName=STATIC_PIPELINE_NAME
          )
          return _get_static_pipeline_execution_arn(sagemaker_session)
      except (
          sagemaker_session.sagemaker_client.exceptions.ResourceNotFound
      ):
          print("Static pipeline execution not found. Starting one.")
          return create_and_execute_static_pipeline(sagemaker_session)
  
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 26 for calling a global function with example usage: static_pipeline_execution_arn(sagemaker_session) and returns: _get_static_pipeline_execution_arn, create_and_execute_static_pipeline