code: def make_workspace(labels, parent_image=None):
      object_set = cellprofiler_core.object.ObjectSet()
      objects = cellprofiler_core.object.Objects()
      objects.segmented = labels
      objects.parent_image = parent_image
      object_set.add_objects(objects, OBJECTS_NAME)
  
      pipeline = cellprofiler_core.pipeline.Pipeline()
      module = (
          cellprofiler.modules.measureimageareaoccupied.MeasureImageAreaOccupied()
      )
      module.set_module_num(1)
      module.operand_choice.value = (
          cellprofiler.modules.measureimageareaoccupied.O_OBJECTS
      )
      module.objects_list.value = OBJECTS_NAME
      pipeline.add_module(module)
      image_set_list = cellprofiler_core.image.ImageSetList()
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline,
          module,
          image_set_list.get_image_set(0),
          object_set,
          cellprofiler_core.measurement.Measurements(),
          image_set_list,
      )
      return workspace
  
file_path: CellProfiler/tests/frontend/modules/test_measureimageareaoccupied.py
imports: import numpy
  import six
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  import cellprofiler.modules.measureimageareaoccupied
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  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, parent_image) and returns: workspace