code: def _test_list_monitoring_alert_history(
      quality_monitor: Union[DefaultModelMonitor, ModelQualityMonitor],
      sagemaker_session: sagemaker.session.Session,
      monitoring_alert_name: str,
      sort_by: str,
      sort_order: str,
      next_token: str,
      max_results: int,
      creation_time_before: str,
      creation_time_after: str,
      status_equals: str,
  ):
      (
          alert_history,
          next_token,
      ) = quality_monitor.list_monitoring_alert_history(
          monitoring_alert_name=monitoring_alert_name,
          sort_by=sort_by,
          sort_order=sort_order,
          creation_time_before=creation_time_before,
          creation_time_after=creation_time_after,
          status_equals=status_equals,
          next_token=next_token,
          max_results=max_results,
      )
  
      sagemaker_session.list_monitoring_alert_history.assert_called_with(
          monitoring_schedule_name=quality_monitor.monitoring_schedule_name,
          monitoring_alert_name=monitoring_alert_name,
          sort_by=sort_by,
          sort_order=sort_order,
          next_token=next_token,
          max_results=max_results,
          status_equals=status_equals,
          creation_time_before=creation_time_before,
          creation_time_after=creation_time_after,
      )
  
      assert len(alert_history) == 1
      assert next_token == "next-token"
      assert alert_history[0] == MonitoringAlertHistorySummary(
          alert_name=MONITORING_ALERT_HISTORY_SUMMARY[
              "MonitoringAlertName"
          ],
          creation_time=MONITORING_ALERT_HISTORY_SUMMARY[
              "CreationTime"
          ],
          alert_status=MONITORING_ALERT_HISTORY_SUMMARY["AlertStatus"],
      )
  
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 25 for calling a global function with example usage: _test_list_monitoring_alert_history(quality_monitor, sagemaker_session, monitoring_alert_name, sort_by, sort_order, next_token, max_results, creation_time_before, creation_time_after, status_equals) without return types