code: def test_saturation_mask():
      """Test percent saturation with mask"""
      image = numpy.zeros((10, 10))
      # 1/2 of image is saturated
      # 1/4 of image is saturated but masked
      image[:5, :] = 1
      mask = numpy.ones((10, 10), bool)
      mask[:5, 5:] = False
      workspace = make_workspace(image, mask)
      q = workspace.module
      q.image_groups[0].check_blur.value = False
      q.image_groups[0].check_saturation.value = True
      q.image_groups[0].check_intensity.value = False
      q.image_groups[0].calculate_threshold.value = False
  
      q.run(workspace)
      m = workspace.measurements
      for feature_name in (
          "ImageQuality_ThresholdOtsu_my_image",
          "ImageQuality_FocusScore_my_image",
          "ImageQuality_LocalFocusScore_my_image_20",
      ):
          assert not m.has_current_measurements(
              "Image", feature_name
          ), ("%s should not be present" % feature_name)
      for feature_name, expected_value in (
          ("ImageQuality_PercentMaximal_my_image", 100.0 / 3),
          ("ImageQuality_PercentMinimal_my_image", 200.0 / 3),
      ):
          assert m.has_current_measurements("Image", feature_name)
          print(
              (
                  feature_name,
                  expected_value,
                  m.get_current_measurement("Image", feature_name),
              )
          )
          assert (
              round(
                  abs(
                      m.get_current_measurement("Image", feature_name)
                      - expected_value
                  ),
                  7,
              )
              == 0
          )
  
imports: import io
  import centrosome.threshold
  import numpy
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT, EXPERIMENT
  from cellprofiler_core.constants.module._identify import O_FOREGROUND, O_THREE_CLASS, O_WEIGHTED_VARIANCE, O_TWO_CLASS, O_ENTROPY, O_BACKGROUND
  import cellprofiler.modules.measureimagequality
  import cellprofiler_core.modules.namesandtypes
  import cellprofiler.modules.smooth
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 11 for calling a global function with example usage: test_saturation_mask() without return types