code: def test_two_expand():
      """Test a labels matrix with two objects"""
      labels = numpy.zeros((10, 10), int)
      labels[2, 2] = 1
      labels[8, 7] = 2
      workspace, module = make_workspace(
          labels,
          cellprofiler.modules.measureobjectneighbors.D_EXPAND,
          5,
      )
      module.run(workspace)
      assert tuple(module.get_categories(None, OBJECTS_NAME)) == (
          "Neighbors",
      )
      assert tuple(
          module.get_measurements(None, OBJECTS_NAME, "Neighbors")
      ) == tuple(cellprofiler.modules.measureobjectneighbors.M_ALL)
      assert tuple(
          module.get_measurement_scales(
              None, OBJECTS_NAME, "Neighbors", "NumberOfNeighbors", None
          )
      ) == ("Expanded",)
      m = workspace.measurements
      neighbors = m.get_current_measurement(
          OBJECTS_NAME, "Neighbors_NumberOfNeighbors_Expanded"
      )
      assert len(neighbors) == 2
      assert numpy.all(neighbors == 1)
      pct = m.get_current_measurement(
          OBJECTS_NAME, "Neighbors_PercentTouching_Expanded"
      )
      #
      # This is what the patch looks like:
      #  P P P P P P P P P P
      #  P I I I I I I I O O
      #  P I I I I I O O O N
      #  P I I I I O O N N N
      #  P I I I O O N N N N
      #  P I I O O N N N N N
      #  P I O O N N N N N N
      #  O O O N N N N N N N
      #  O N N N N N N N N N
      #  N N N N N N N N N N
      #
      # where P = perimeter, but not overlapping the second object
      #       I = interior, not perimeter
      #       O = dilated 2nd object overlaps perimeter
      #       N = neigbor object, not overlapping
      #
      # There are 33 perimeter pixels (P + O) and 17 perimeter pixels
      # that overlap the dilated neighbor (O).
      #
      assert len(pct) == 2
      assert round(abs(pct[0] - 100.0 * 17.0 / 33.0), 7) == 0
      fo = m.get_current_measurement(
          OBJECTS_NAME, "Neighbors_FirstClosestObjectNumber_Expanded"
      )
      assert len(fo) == 2
      assert fo[0] == 2
      assert fo[1] == 1
      x = m.get_current_measurement(
          OBJECTS_NAME, "Neighbors_FirstClosestDistance_Expanded"
      )
      assert round(abs(len(x) - 2), 7) == 0
      assert round(abs(x[0] - numpy.sqrt(61)), 7) == 0
      assert round(abs(x[1] - numpy.sqrt(61)), 7) == 0
  
imports: import numpy
  import six.moves
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import COLTYPE_INTEGER, COLTYPE_FLOAT, NEIGHBORS, R_FIRST_OBJECT_NUMBER, R_SECOND_OBJECT_NUMBER
  from cellprofiler_core.measurement import RelationshipKey
  import cellprofiler.modules.measureobjectneighbors
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 5 for calling a global function with example usage: test_two_expand() without return types