code: def make_workspace(labels, mode, distance=0, neighbors_labels=None):
      """Make a workspace for testing MeasureObjectNeighbors"""
      module = (
          cellprofiler.modules.measureobjectneighbors.MeasureObjectNeighbors()
      )
      module.set_module_num(1)
      module.object_name.value = OBJECTS_NAME
      module.distance_method.value = mode
      module.distance.value = distance
      pipeline = cellprofiler_core.pipeline.Pipeline()
      pipeline.add_module(module)
      object_set = cellprofiler_core.object.ObjectSet()
      image_set_list = cellprofiler_core.image.ImageSetList()
      image_set = image_set_list.get_image_set(0)
      measurements = cellprofiler_core.measurement.Measurements()
      measurements.group_index = 1
      measurements.group_number = 1
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline,
          module,
          image_set,
          object_set,
          measurements,
          image_set_list,
      )
      objects = cellprofiler_core.object.Objects()
      objects.segmented = labels
      object_set.add_objects(objects, OBJECTS_NAME)
      if neighbors_labels is None:
          module.neighbors_name.value = OBJECTS_NAME
      else:
          module.neighbors_name.value = NEIGHBORS_NAME
          objects = cellprofiler_core.object.Objects()
          objects.segmented = neighbors_labels
          object_set.add_objects(objects, NEIGHBORS_NAME)
      return workspace, module
  
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 1 for calling a global function with example usage: make_workspace(labels, mode, distance, neighbors_labels) and returns: workspace,  module