code: def test_remove_percent():
      labels = numpy.zeros((20, 10), int)
      labels[2:8, 3:6] = 1
      labels[12:18, 3:7] = 2
      mask = numpy.zeros((20, 10), bool)
      mask[3:17, 2:6] = True
      # loses 3 of 18 from object 1 = .1666
      # loses 9 of 24 from object 2 = .375
      expected = labels.copy()
      expected[labels == 2] = 0
      workspace, module = make_workspace(
          labels,
          cellprofiler.modules.maskobjects.P_REMOVE_PERCENTAGE,
          masking_image=mask,
      )
      module.overlap_fraction.value = 0.75
      module.run(workspace)
      objects = workspace.object_set.get_objects(OUTPUT_OBJECTS)
      assert numpy.all(objects.segmented == expected)
  
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 16 for calling a global function with example usage: test_remove_percent() without return types