code: def test_non_contiguous():
      """make sure MeasureObjectAreaShape doesn't crash if fed non-contiguous objects"""
      module = (
          cellprofiler.modules.measureobjectsizeshape.MeasureObjectAreaShape()
      )
      module.objects_list.value.append("SomeObjects")
      module.calculate_zernikes.value = True
      object_set = cellprofiler_core.object.ObjectSet()
      labels = numpy.zeros((10, 20), int)
      labels[1:9, 1:5] = 1
      labels[4:6, 6:19] = 1
      objects = cellprofiler_core.object.Objects()
      objects.segmented = labels
      object_set.add_objects(objects, "SomeObjects")
      module.set_module_num(1)
      image_set_list = cellprofiler_core.image.ImageSetList()
      measurements = cellprofiler_core.measurement.Measurements()
      pipeline = cellprofiler_core.pipeline.Pipeline()
      pipeline.add_module(module)
  
      def callback(caller, event):
          assert not isinstance(
              event, cellprofiler_core.pipeline.event.RunException
          )
  
      pipeline.add_listener(callback)
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline,
          module,
          image_set_list.get_image_set(0),
          object_set,
          measurements,
          image_set_list,
      )
      module.run(workspace)
      values = measurements.get_current_measurement(
          "SomeObjects", "AreaShape_Perimeter"
      )
      assert len(values) == 1
      assert values[0] == 46
  
imports: import io
  import os
  import numpy
  import skimage.io
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.modules.injectimage
  import cellprofiler.modules.measureobjectsizeshape
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.workspace
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  import tests.frontend
  import tests.frontend.modules
label_desc: Use image node_id 8 for calling a global function with example usage: test_non_contiguous() without return types