code: def validate_scheduled_pipeline_execution(
      execution_arn: str,
      pipeline_arn: str,
      no_of_steps: int,
      last_step_name: str,
      status: str,
      session: Session,
  ):
      _pipeline_execution = _PipelineExecution(
          arn=execution_arn,
          sagemaker_session=session,
      )
      response = _pipeline_execution.describe()
      assert response["PipelineArn"] == pipeline_arn
  
      wait_pipeline_execution(
          execution=_pipeline_execution, delay=20, max_attempts=20
      )
  
      execution_steps = _pipeline_execution.list_steps()
  
      assert len(execution_steps) == no_of_steps
  
      assert last_step_name in execution_steps[0]["StepName"]
      assert execution_steps[0]["StepStatus"] == status
  
file_path: sagemaker-python-sdk/tests/integ/sagemaker/workflow/helpers.py
imports: from __future__ import absolute_import
  import re
  from botocore.exceptions import WaiterError
  from sagemaker import Session
  from sagemaker.workflow.pipeline import _PipelineExecution
  from sagemaker.workflow.pipeline import Pipeline
label_desc: Use image node_id 3 for calling a global function with example usage: validate_scheduled_pipeline_execution(execution_arn, pipeline_arn, no_of_steps, last_step_name, status, session) without return types