code: def test_mask_with_objects():
      labels = numpy.zeros((20, 10), int)
      labels[2:8, 3:7] = 1
      labels[12:18, 3:7] = 2
      mask = numpy.zeros((20, 10), int)
      mask[3:17, 2:6] = 1
      expected = labels.copy()
      expected[mask == 0] = 0
      workspace, module = make_workspace(
          labels, cellprofiler.modules.maskobjects.P_MASK, mask
      )
      module.run(workspace)
      objects = workspace.object_set.get_objects(OUTPUT_OBJECTS)
      assert numpy.all(objects.segmented == expected)
  
      expected_x = numpy.array([4, 4])
      expected_y = numpy.array([5, 14])
      m = workspace.measurements
      assert isinstance(m, cellprofiler_core.measurement.Measurements)
      value = m.get_current_image_measurement(FF_COUNT % OUTPUT_OBJECTS)
      assert value == 2
  
      for object_name, feature, expected in (
          (OUTPUT_OBJECTS, M_LOCATION_CENTER_X, expected_x),
          (OUTPUT_OBJECTS, M_LOCATION_CENTER_Y, expected_y),
          (
              OUTPUT_OBJECTS,
              M_NUMBER_OBJECT_NUMBER,
              numpy.array([1, 2]),
          ),
          (
              OUTPUT_OBJECTS,
              FF_PARENT % INPUT_OBJECTS,
              numpy.array([1, 2]),
          ),
          (
              INPUT_OBJECTS,
              FF_CHILDREN_COUNT % OUTPUT_OBJECTS,
              numpy.array([1, 1]),
          ),
      ):
          data = m.get_current_measurement(object_name, feature)
          assert len(data) == len(expected)
          for value, e in zip(data, expected):
              assert value == e
  
imports: import numpy
  import six.moves
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.measurement
  import cellprofiler_core.modules
  from cellprofiler_core.constants.measurement import FF_COUNT, COLTYPE_INTEGER, M_LOCATION_CENTER_X, COLTYPE_FLOAT, M_LOCATION_CENTER_Y, FF_PARENT, M_NUMBER_OBJECT_NUMBER, FF_CHILDREN_COUNT, C_COUNT, C_LOCATION, C_NUMBER, C_PARENT, C_CHILDREN, FTR_CENTER_X, FTR_CENTER_Y, FTR_OBJECT_NUMBER
  import cellprofiler.modules.maskobjects
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 9 for calling a global function with example usage: test_mask_with_objects() without return types