code: def test_keep_one_max():
      """Keep two sub-objects (max) from among four enclosed by two"""
      sub_labels = numpy.zeros((20, 20), int)
      expected = numpy.zeros((20, 20), int)
      for i, j, k, e in (
          (0, 0, 1, 0),
          (10, 0, 2, 1),
          (0, 10, 3, 2),
          (10, 10, 4, 0),
      ):
          sub_labels[i + 2 : i + 5, j + 3 : j + 7] = k
          expected[i + 2 : i + 5, j + 3 : j + 7] = e
      labels = numpy.zeros((20, 20), int)
      labels[:, :10] = 1
      labels[:, 10:] = 2
      workspace, module = make_workspace(
          {INPUT_OBJECTS: sub_labels, ENCLOSING_OBJECTS: labels}
      )
      module.x_name.value = INPUT_OBJECTS
      module.y_name.value = OUTPUT_OBJECTS
      module.enclosing_object_name.value = ENCLOSING_OBJECTS
      module.measurements[0].measurement.value = TEST_FTR
      module.filter_choice.value = (
          cellprofiler.modules.filterobjects.FI_MAXIMAL_PER_OBJECT
      )
      m = workspace.measurements
      m.add_measurement(
          INPUT_OBJECTS, TEST_FTR, numpy.array([1, 2, 4, 3])
      )
      module.run(workspace)
      labels = workspace.object_set.get_objects(OUTPUT_OBJECTS)
      assert numpy.all(labels.segmented == expected)
  
imports: import contextlib
  import io
  import os
  import pickle
  import tempfile
  import numpy
  import pytest
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.modules
  from cellprofiler_core.constants.measurement import FF_PARENT, FF_COUNT, FF_CHILDREN_COUNT, M_LOCATION_CENTER_X, M_LOCATION_CENTER_Y, M_LOCATION_CENTER_Z, M_NUMBER_OBJECT_NUMBER
  import cellprofiler.modules.filterobjects
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 9 for calling a global function with example usage: test_keep_one_max() without return types