code: def test_one_neighbor():
      olabels = numpy.zeros((20, 10), int)
      olabels[2, 2] = 1
      nlabels = numpy.zeros((20, 10), int)
      nlabels[-2, -2] = 1
      for mode in cellprofiler.modules.measureobjectneighbors.D_ALL:
          workspace, module = make_workspace(
              olabels, mode, distance=20, 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] == 1
          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] == 0
          v = m.get_current_measurement(
              OBJECTS_NAME,
              module.get_measurement_name(
                  cellprofiler.modules.measureobjectneighbors.M_FIRST_CLOSEST_DISTANCE
              ),
          )
          assert len(v) == 1
          assert round(abs(v[0] - numpy.sqrt(16**2 + 6**2)), 7) == 0
          v = m.get_current_measurement(
              OBJECTS_NAME,
              module.get_measurement_name(
                  cellprofiler.modules.measureobjectneighbors.M_NUMBER_OF_NEIGHBORS
              ),
          )
          assert len(v) == 1
          assert v[0] == (
              0
              if mode
              == cellprofiler.modules.measureobjectneighbors.D_ADJACENT
              else 1
          )
  
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 18 for calling a global function with example usage: test_one_neighbor() without return types