code: def test_relationships():
      labels = numpy.array(
          [
              [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
              [0, 1, 1, 1, 0, 0, 0, 2, 2, 2],
              [0, 1, 1, 1, 0, 0, 0, 2, 2, 2],
              [0, 1, 1, 1, 0, 0, 0, 2, 2, 2],
              [0, 0, 0, 0, 3, 3, 3, 0, 0, 0],
              [0, 0, 0, 0, 3, 3, 3, 0, 0, 0],
              [0, 0, 0, 0, 3, 3, 3, 0, 0, 0],
              [0, 4, 4, 4, 0, 0, 0, 5, 5, 5],
              [0, 4, 4, 4, 0, 0, 0, 5, 5, 5],
              [0, 4, 4, 4, 0, 0, 0, 5, 5, 5],
              [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
          ]
      )
  
      workspace, module = make_workspace(
          labels,
          cellprofiler.modules.measureobjectneighbors.D_WITHIN,
          2,
      )
      module.run(workspace)
      m = workspace.measurements
      assert isinstance(m, cellprofiler_core.measurement.Measurements)
      k = m.get_relationship_groups()
      assert len(k) == 1
      k = k[0]
      assert isinstance(k, RelationshipKey)
      assert k.module_number == 1
      assert k.object_name1 == OBJECTS_NAME
      assert k.object_name2 == OBJECTS_NAME
      assert k.relationship == NEIGHBORS
      r = m.get_relationships(
          k.module_number,
          k.relationship,
          k.object_name1,
          k.object_name2,
      )
      assert len(r) == 8
      ro1 = r[R_FIRST_OBJECT_NUMBER]
      ro2 = r[R_SECOND_OBJECT_NUMBER]
      numpy.testing.assert_array_equal(
          numpy.unique(ro1[ro2 == 3]), numpy.array([1, 2, 4, 5])
      )
      numpy.testing.assert_array_equal(
          numpy.unique(ro2[ro1 == 3]), numpy.array([1, 2, 4, 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 21 for calling a global function with example usage: test_relationships() without return types