code: def _wait_for_first_execution_to_complete(monitor):
      for _ in retries(
          max_retry_count=30,
          exception_message_prefix="Waiting for first execution to reach terminal state",
          seconds_to_sleep=60,
      ):
          schedule_desc = monitor.describe_schedule()
          execution_summary = schedule_desc.get(
              "LastMonitoringExecutionSummary"
          )
  
          # Once there is an execution, we can break
          if execution_summary is not None:
              monitor.stop_monitoring_schedule()
              last_execution_status = execution_summary[
                  "MonitoringExecutionStatus"
              ]
  
              if last_execution_status not in ["Pending", "InProgess"]:
                  # to prevent delete as it takes sometime for schedule to update out of InProgress
                  time.sleep(120)
                  break
  
imports: from __future__ import absolute_import
  import json
  import os
  import uuid
  import time
  import pytest
  import tests.integ
  import tests.integ.timeout
  from sagemaker.s3 import S3Uploader
  from datetime import datetime, timedelta
  from tests.integ import DATA_DIR
  from sagemaker.model_monitor import DatasetFormat
  from sagemaker.model_monitor import MonitoringDatasetFormat
  from sagemaker.model_monitor import NetworkConfig, Statistics, Constraints
  from sagemaker.model_monitor import ModelMonitor
  from sagemaker.model_monitor import DefaultModelMonitor
  from sagemaker.model_monitor import MonitoringOutput
  from sagemaker.model_monitor import DataCaptureConfig
  from sagemaker.model_monitor import BatchTransformInput
  from sagemaker.model_monitor import DataQualityMonitoringConfig
  from sagemaker.model_monitor import DataQualityDistributionConstraints
  from sagemaker.model_monitor.data_capture_config import _MODEL_MONITOR_S3_PATH
  from sagemaker.model_monitor.data_capture_config import _DATA_CAPTURE_S3_PATH
  from sagemaker.model_monitor import CronExpressionGenerator
  from sagemaker.model_monitor.monitoring_alert import MonitoringAlertSummary
  from sagemaker.processing import ProcessingInput
  from sagemaker.processing import ProcessingOutput
  from sagemaker.tensorflow.model import TensorFlowModel
  from sagemaker.utils import unique_name_from_base
  from tests.integ.kms_utils import get_or_create_kms_key
  from tests.integ.retry import retries
label_desc: Use image node_id 35 for calling a global function with example usage: _wait_for_first_execution_to_complete(monitor) without return types