code: def make_workspace(
      labels,
      overlap_choice,
      masking_objects=None,
      masking_image=None,
      renumber=True,
  ):
      module = cellprofiler.modules.maskobjects.MaskObjects()
      module.set_module_num(1)
      module.object_name.value = INPUT_OBJECTS
      module.remaining_objects.value = OUTPUT_OBJECTS
      module.mask_choice.value = (
          cellprofiler.modules.maskobjects.MC_OBJECTS
          if masking_objects is not None
          else cellprofiler.modules.maskobjects.MC_IMAGE
      )
      module.masking_image.value = MASKING_IMAGE
      module.masking_objects.value = MASKING_OBJECTS
      module.retain_or_renumber.value = (
          cellprofiler.modules.maskobjects.R_RENUMBER
          if renumber
          else cellprofiler.modules.maskobjects.R_RETAIN
      )
      module.overlap_choice.value = overlap_choice
  
      pipeline = cellprofiler_core.pipeline.Pipeline()
  
      def callback(caller, event):
          assert not isinstance(
              event, cellprofiler_core.pipeline.event.RunException
          )
  
      pipeline.add_listener(callback)
      pipeline.add_module(module)
  
      object_set = cellprofiler_core.object.ObjectSet()
      io = cellprofiler_core.object.Objects()
      io.segmented = labels
      object_set.add_objects(io, INPUT_OBJECTS)
  
      if masking_objects is not None:
          oo = cellprofiler_core.object.Objects()
          oo.segmented = masking_objects
          object_set.add_objects(oo, MASKING_OBJECTS)
  
      image_set_list = cellprofiler_core.image.ImageSetList()
      image_set = image_set_list.get_image_set(0)
      if masking_image is not None:
          mi = cellprofiler_core.image.Image(masking_image)
          image_set.add(MASKING_IMAGE, mi)
  
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline,
          module,
          image_set,
          object_set,
          cellprofiler_core.measurement.Measurements(),
          image_set_list,
      )
      return workspace, module
  
imports: import numpy
  import six.moves
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.measurement
  import cellprofiler_core.modules
  from cellprofiler_core.constants.measurement import FF_COUNT, COLTYPE_INTEGER, M_LOCATION_CENTER_X, COLTYPE_FLOAT, M_LOCATION_CENTER_Y, FF_PARENT, M_NUMBER_OBJECT_NUMBER, FF_CHILDREN_COUNT, C_COUNT, C_LOCATION, C_NUMBER, C_PARENT, C_CHILDREN, FTR_CENTER_X, FTR_CENTER_Y, FTR_OBJECT_NUMBER
  import cellprofiler.modules.maskobjects
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 4 for calling a global function with example usage: make_workspace(labels, overlap_choice, masking_objects, masking_image, renumber) and returns: workspace,  module