code: def _test_model_bias_monitor_update_schedule(
      model_bias_monitor, sagemaker_session
  ):
      # update schedule
      sagemaker_session.describe_monitoring_schedule = MagicMock()
      sagemaker_session.sagemaker_client.describe_model_bias_job_definition = (
          MagicMock()
      )
      sagemaker_session.sagemaker_client.create_model_bias_job_definition = (
          MagicMock()
      )
      model_bias_monitor.update_monitoring_schedule(
          schedule_cron_expression=CRON_DAILY
      )
      sagemaker_session.sagemaker_client.update_monitoring_schedule.assert_called_once_with(
          MonitoringScheduleName=model_bias_monitor.monitoring_schedule_name,
          MonitoringScheduleConfig={
              "MonitoringJobDefinitionName": model_bias_monitor.job_definition_name,
              "MonitoringType": ModelBiasMonitor.monitoring_type(),
              "ScheduleConfig": {"ScheduleExpression": CRON_DAILY},
          },
      )
      sagemaker_session.sagemaker_client.describe_model_bias_job_definition.assert_not_called()
      sagemaker_session.sagemaker_client.delete_model_bias_job_definition.assert_not_called()
      sagemaker_session.sagemaker_client.create_model_bias_job_definition.assert_not_called()
  
      # update one property of job definition
      time.sleep(
          0.001
      )  # Make sure timestamp changed so that a different job definition name is generated
      sagemaker_session.sagemaker_client.update_monitoring_schedule = (
          Mock()
      )
      sagemaker_session.sagemaker_client.describe_model_bias_job_definition = Mock(
          return_value=copy.deepcopy(BIAS_JOB_DEFINITION)
      )
      sagemaker_session.sagemaker_client.create_model_bias_job_definition = (
          Mock()
      )
      sagemaker_session.expand_role = Mock(return_value=NEW_ROLE_ARN)
      old_job_definition_name = model_bias_monitor.job_definition_name
      model_bias_monitor.update_monitoring_schedule(role=NEW_ROLE_ARN)
      expected_arguments = {
          "JobDefinitionName": model_bias_monitor.job_definition_name,
          **copy.deepcopy(BIAS_JOB_DEFINITION),
          "Tags": TAGS,
      }
      assert (
          old_job_definition_name
          != model_bias_monitor.job_definition_name
      )
      assert model_bias_monitor.role == NEW_ROLE_ARN
      assert model_bias_monitor.instance_count == INSTANCE_COUNT
      assert model_bias_monitor.instance_type == INSTANCE_TYPE
      assert model_bias_monitor.volume_size_in_gb == VOLUME_SIZE_IN_GB
      assert model_bias_monitor.volume_kms_key == VOLUME_KMS_KEY
      assert model_bias_monitor.output_kms_key == OUTPUT_KMS_KEY
      assert (
          model_bias_monitor.max_runtime_in_seconds
          == MAX_RUNTIME_IN_SECONDS
      )
      assert model_bias_monitor.env == ENVIRONMENT
      assert model_bias_monitor.network_config == NETWORK_CONFIG
      expected_arguments[
          "RoleArn"
      ] = NEW_ROLE_ARN  # all but role arn are from existing job definition
      sagemaker_session.sagemaker_client.create_model_bias_job_definition.assert_called_once_with(
          **expected_arguments
      )
      sagemaker_session.sagemaker_client.update_monitoring_schedule.assert_called_once_with(
          MonitoringScheduleName=model_bias_monitor.monitoring_schedule_name,
          MonitoringScheduleConfig={
              "MonitoringJobDefinitionName": model_bias_monitor.job_definition_name,
              "MonitoringType": ModelBiasMonitor.monitoring_type(),
          },
      )
      sagemaker_session.sagemaker_client.describe_model_bias_job_definition.assert_called_once_with(
          JobDefinitionName=old_job_definition_name
      )
      sagemaker_session.sagemaker_client.delete_model_bias_job_definition.assert_not_called()
  
      # update full job definition
      time.sleep(
          0.001
      )  # Make sure timestamp changed so that a different job definition name is generated
      sagemaker_session.sagemaker_client.update_monitoring_schedule = (
          Mock()
      )
      sagemaker_session.sagemaker_client.describe_model_bias_job_definition = Mock(
          return_value=copy.deepcopy(BIAS_JOB_DEFINITION)
      )
      sagemaker_session.sagemaker_client.create_model_bias_job_definition = (
          Mock()
      )
      sagemaker_session.expand_role = Mock(return_value=NEW_ROLE_ARN)
      old_job_definition_name = model_bias_monitor.job_definition_name
      model_bias_monitor.role = ROLE_ARN
      model_bias_monitor.update_monitoring_schedule(
          endpoint_input=EndpointInput(
              endpoint_name=NEW_ENDPOINT_NAME,
              destination=ENDPOINT_INPUT_LOCAL_PATH,
              start_time_offset=NEW_START_TIME_OFFSET,
              end_time_offset=NEW_END_TIME_OFFSET,
              features_attribute=NEW_FEATURES_ATTRIBUTE,
              inference_attribute=NEW_INFERENCE_ATTRIBUTE,
              probability_attribute=NEW_PROBABILITY_ATTRIBUTE,
              probability_threshold_attribute=NEW_PROBABILITY_THRESHOLD_ATTRIBUTE,
          ),
          ground_truth_input=NEW_GROUND_TRUTH_S3_URI,
          analysis_config=NEW_ANALYSIS_CONFIG_S3_URI,
          output_s3_uri=NEW_OUTPUT_S3_URI,
          constraints=NEW_CONSTRAINTS,
          enable_cloudwatch_metrics=False,
          role=NEW_ROLE_ARN,
          instance_count=NEW_INSTANCE_COUNT,
          instance_type=NEW_INSTANCE_TYPE,
          volume_size_in_gb=NEW_VOLUME_SIZE_IN_GB,
          volume_kms_key=NEW_VOLUME_KMS_KEY,
          output_kms_key=NEW_OUTPUT_KMS_KEY,
          max_runtime_in_seconds=NEW_MAX_RUNTIME_IN_SECONDS,
          env=NEW_ENVIRONMENT,
          network_config=NEW_NETWORK_CONFIG,
          schedule_cron_expression=CRON_DAILY,
      )
      assert (
          old_job_definition_name
          != model_bias_monitor.job_definition_name
      )
      assert model_bias_monitor.role == NEW_ROLE_ARN
      assert model_bias_monitor.instance_count == NEW_INSTANCE_COUNT
      assert model_bias_monitor.instance_type == NEW_INSTANCE_TYPE
      assert (
          model_bias_monitor.volume_size_in_gb == NEW_VOLUME_SIZE_IN_GB
      )
      assert model_bias_monitor.volume_kms_key == NEW_VOLUME_KMS_KEY
      assert model_bias_monitor.output_kms_key == NEW_OUTPUT_KMS_KEY
      assert (
          model_bias_monitor.max_runtime_in_seconds
          == NEW_MAX_RUNTIME_IN_SECONDS
      )
      assert model_bias_monitor.env == NEW_ENVIRONMENT
      assert model_bias_monitor.network_config == NEW_NETWORK_CONFIG
      expected_arguments = {  # all from new job definition
          "JobDefinitionName": model_bias_monitor.job_definition_name,
          **copy.deepcopy(NEW_BIAS_JOB_DEFINITION),
          "Tags": TAGS,
      }
      sagemaker_session.sagemaker_client.create_model_bias_job_definition.assert_called_once_with(
          **expected_arguments
      )
      sagemaker_session.sagemaker_client.update_monitoring_schedule.assert_called_once_with(
          MonitoringScheduleName=model_bias_monitor.monitoring_schedule_name,
          MonitoringScheduleConfig={
              "MonitoringJobDefinitionName": model_bias_monitor.job_definition_name,
              "MonitoringType": ModelBiasMonitor.monitoring_type(),
              "ScheduleConfig": {"ScheduleExpression": CRON_DAILY},
          },
      )
      sagemaker_session.sagemaker_client.describe_model_bias_job_definition.assert_called_once_with(
          JobDefinitionName=old_job_definition_name
      )
      sagemaker_session.sagemaker_client.delete_model_bias_job_definition.assert_not_called()
  
imports: from __future__ import print_function, absolute_import
  import copy
  import json
  import time
  from mock import patch, Mock, MagicMock
  import pytest
  from sagemaker.clarify import BiasConfig, DataConfig, ModelConfig, SHAPConfig, ModelPredictedLabelConfig
  from sagemaker.model_monitor import BiasAnalysisConfig, Constraints, CronExpressionGenerator, EndpointInput, BatchTransformInput, ExplainabilityAnalysisConfig, ModelBiasMonitor, ModelExplainabilityMonitor, MonitoringExecution, NetworkConfig
  from sagemaker.model_monitor.clarify_model_monitoring import ClarifyModelMonitor, ClarifyBaseliningJob, ClarifyMonitoringExecution
  from sagemaker.model_monitor.dataset_format import MonitoringDatasetFormat
label_desc: Use image node_id 30 for calling a global function with example usage: _test_model_bias_monitor_update_schedule(model_bias_monitor, sagemaker_session) without return types