code: def _test_list_monitoring_alerts(
      quality_monitor: Union[DefaultModelMonitor, ModelQualityMonitor],
      sagemaker_session: sagemaker.session.Session,
      next_token: str,
      max_results: int,
  ):
      alerts, next_token = quality_monitor.list_monitoring_alerts(
          next_token=next_token,
          max_results=max_results,
      )
  
      sagemaker_session.list_monitoring_alerts.assert_called_with(
          monitoring_schedule_name=quality_monitor.monitoring_schedule_name,
          next_token=next_token,
          max_results=max_results,
      )
  
      assert len(alerts) == 1
      assert next_token == "next-token"
      assert alerts[0] == MonitoringAlertSummary(
          alert_name=MONITORING_ALERT_SUMMARY["MonitoringAlertName"],
          creation_time=MONITORING_ALERT_SUMMARY["CreationTime"],
          last_modified_time=MONITORING_ALERT_SUMMARY[
              "LastModifiedTime"
          ],
          alert_status=MONITORING_ALERT_SUMMARY["AlertStatus"],
          data_points_to_alert=MONITORING_ALERT_SUMMARY[
              "DatapointsToAlert"
          ],
          evaluation_period=MONITORING_ALERT_SUMMARY[
              "EvaluationPeriod"
          ],
          actions=MonitoringAlertActions(
              model_dashboard_indicator=ModelDashboardIndicatorAction(
                  enabled=MONITORING_ALERT_SUMMARY["Actions"][
                      "ModelDashboardIndicator"
                  ]["Enabled"]
              )
          ),
      )
  
imports: from __future__ import absolute_import
  import copy
  import time
  from typing import Union
  import sagemaker
  import pytest
  from mock import Mock, patch, MagicMock
  from sagemaker.model_monitor import ModelMonitor, Constraints, CronExpressionGenerator, DefaultModelMonitor, EndpointInput, BatchTransformInput, ModelQualityMonitor, Statistics, MonitoringOutput, DataQualityMonitoringConfig, DataQualityDistributionConstraints
  from sagemaker.model_monitor.monitoring_alert import MonitoringAlertSummary, MonitoringAlertHistorySummary, MonitoringAlertActions, ModelDashboardIndicatorAction
  from sagemaker.network import NetworkConfig
  from sagemaker.model_monitor.dataset_format import MonitoringDatasetFormat, DatasetFormat
  from tests.unit import SAGEMAKER_CONFIG_MONITORING_SCHEDULE
label_desc: Use image node_id 24 for calling a global function with example usage: _test_list_monitoring_alerts(quality_monitor, sagemaker_session, next_token, max_results) without return types