code: def test_different_neighbors_touching():
      olabels = numpy.zeros((20, 10), int)
      olabels[2:5, 2:5] = 1
      nlabels = numpy.zeros((20, 10), int)
      nlabels[3, 5] = 2
      nlabels[5, 2] = 1
      workspace, module = make_workspace(
          olabels,
          cellprofiler.modules.measureobjectneighbors.D_ADJACENT,
          distance=0,
          neighbors_labels=nlabels,
      )
      assert isinstance(
          module,
          cellprofiler.modules.measureobjectneighbors.MeasureObjectNeighbors,
      )
      module.run(workspace)
      m = workspace.measurements
      assert isinstance(m, cellprofiler_core.measurement.Measurements)
      v = m.get_current_measurement(
          OBJECTS_NAME,
          module.get_measurement_name(
              cellprofiler.modules.measureobjectneighbors.M_FIRST_CLOSEST_OBJECT_NUMBER
          ),
      )
      assert len(v) == 1
      assert v[0] == 2
      v = m.get_current_measurement(
          OBJECTS_NAME,
          module.get_measurement_name(
              cellprofiler.modules.measureobjectneighbors.M_SECOND_CLOSEST_OBJECT_NUMBER
          ),
      )
      assert len(v) == 1
      assert v[0] == 1
      v = m.get_current_measurement(
          OBJECTS_NAME,
          module.get_measurement_name(
              cellprofiler.modules.measureobjectneighbors.M_FIRST_CLOSEST_DISTANCE
          ),
      )
      assert len(v) == 1
      assert v[0] == 2
      v = m.get_current_measurement(
          OBJECTS_NAME,
          module.get_measurement_name(
              cellprofiler.modules.measureobjectneighbors.M_SECOND_CLOSEST_DISTANCE
          ),
      )
      assert len(v) == 1
      assert round(v[0], 7) == round(5 ** (0.5), 7)
      v = m.get_current_measurement(
          OBJECTS_NAME,
          module.get_measurement_name(
              cellprofiler.modules.measureobjectneighbors.M_PERCENT_TOUCHING
          ),
      )
      assert len(v) == 1
      assert round(v[0], 7) == 62.5
  
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 20 for calling a global function with example usage: test_different_neighbors_touching() without return types