code: def test_run():
      """Run with a rectangle, cross and circle"""
      object_set = cellprofiler_core.object.ObjectSet()
      labels = numpy.zeros((10, 20), int)
      labels[1:9, 1:5] = 1
      labels[1:9, 11] = 2
      labels[4, 6:19] = 2
      objects = cellprofiler_core.object.Objects()
      objects.segmented = labels
      object_set.add_objects(objects, "SomeObjects")
      labels = numpy.zeros((115, 115), int)
      x, y = numpy.mgrid[-50:51, -50:51]
      labels[:101, :101][x**2 + y**2 <= 2500] = 1
      objects = cellprofiler_core.object.Objects()
      objects.segmented = labels
      object_set.add_objects(objects, "OtherObjects")
      module = (
          cellprofiler.modules.measureobjectsizeshape.MeasureObjectAreaShape()
      )
      settings = ["SomeObjects", "OtherObjects", "Yes"]
      module.set_settings_from_values(
          settings, 1, module.module_class()
      )
      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)
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline,
          module,
          image_set_list.get_image_set(0),
          object_set,
          measurements,
          image_set_list,
      )
      module.run(workspace)
      features_and_columns_match(measurements, module, pipeline)
  
      a = measurements.get_current_measurement(
          "SomeObjects", "AreaShape_Area"
      )
      assert len(a) == 2
      assert a[0] == 32
      assert a[1] == 20
      #
      # Mini-test of the form factor of a circle
      #
      ff = measurements.get_current_measurement(
          "OtherObjects", "AreaShape_FormFactor"
      )
      assert len(ff) == 1
      perim = measurements.get_current_measurement(
          "OtherObjects", "AreaShape_Perimeter"
      )
      area = measurements.get_current_measurement(
          "OtherObjects", "AreaShape_Area"
      )
      # The perimeter is obtained geometrically and is overestimated.
      expected = 100 * numpy.pi
      diff = abs((perim[0] - expected) / (perim[0] + expected))
      assert diff < 0.05, "perimeter off by %f" % diff
      wrongness = (perim[0] / expected) ** 2
  
      # It's an approximate circle...
      expected = numpy.pi * 50.0**2
      diff = abs((area[0] - expected) / (area[0] + expected))
      assert diff < 0.05, "area off by %f" % diff
      wrongness *= expected / area[0]
  
      assert round(abs(ff[0] * wrongness - 1.0), 7) == 0
      for object_name, object_count in (
          ("SomeObjects", 2),
          ("OtherObjects", 1),
      ):
          for measurement in module.get_measurements(
              pipeline, object_name, "AreaShape"
          ):
              feature_name = "AreaShape_%s" % measurement
              m = measurements.get_current_measurement(
                  object_name, feature_name
              )
              assert len(m) == object_count
  
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 4 for calling a global function with example usage: test_run() without return types