code: def test_image_and_mask(image, measurements, module, workspace):
      """Test operation on a masked image"""
      numpy.random.seed(0)
  
      pixels = (
          numpy.random.uniform(size=(10, 10)).astype(numpy.float32)
          * 0.99
      )
  
      pixels[1:3, 1:3] = 1
  
      mask = numpy.zeros((10, 10), bool)
  
      mask[1:9, 1:9] = True
  
      image.pixel_data = pixels
  
      image.mask = mask
  
      module.run(workspace)
  
      assert (
          measurements.get_current_measurement(
              "Image", "Intensity_TotalArea_image"
          )
          == 64
      )
  
      assert measurements.get_current_measurement(
          "Image", "Intensity_TotalIntensity_image"
      ) == numpy.sum(pixels[1:9, 1:9])
  
      assert (
          measurements.get_current_measurement(
              "Image", "Intensity_MeanIntensity_image"
          )
          == numpy.sum(pixels[1:9, 1:9]) / 64.0
      )
  
      assert (
          measurements.get_current_measurement(
              "Image", "Intensity_PercentMaximal_image"
          )
          == 400.0 / 64.0
      )
  
imports: import numpy
  import numpy.testing
  import pytest
  import skimage.morphology
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.module
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT, COLTYPE_INTEGER
  import cellprofiler.modules.measureimageintensity
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.workspace
label_desc: Use image node_id 13 for calling a global function with example usage: test_image_and_mask(image, measurements, module, workspace) without return types