code: def create_and_execute_static_pipeline(sagemaker_session):
      # start the execution and wait for success
      print(
          f"Starting static execution of pipeline '{STATIC_PIPELINE_NAME}'"
      )
      try:
          execution_arn = test_end_to_end_pipeline_successful_execution(
              sagemaker_session=sagemaker_session,
              region_name=sagemaker_session.boto_session.region_name,
              role=get_execution_role(sagemaker_session),
              pipeline_name=STATIC_PIPELINE_NAME,
              wait=True,
          )
  
          # now deploy the model package to an endpoint
          _deploy_static_endpoint(
              execution_arn=execution_arn,
              sagemaker_session=sagemaker_session,
          )
  
          return execution_arn
      except Exception:
          # Pipeline already exists, meaning an execution was started by
          # tests in a different thread
          execution_arn = _get_static_pipeline_execution_arn(
              sagemaker_session
          )
          _deploy_static_endpoint(
              execution_arn=execution_arn,
              sagemaker_session=sagemaker_session,
          )
          return 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 41 for calling a global function with example usage: create_and_execute_static_pipeline(sagemaker_session) and returns: execution_arn, execution_arn