code: def test_load_v4():
      file = tests.frontend.modules.get_test_resources_directory(
          "measureobjectintensitydistribution/v4.pipeline"
      )
      with open(file, "r") as fd:
          data = fd.read()
  
      pipeline = cellprofiler_core.pipeline.Pipeline()
  
      def callback(caller, event):
          assert not isinstance(
              event, cellprofiler_core.pipeline.event.LoadException
          )
  
      pipeline.add_listener(callback)
      pipeline.load(io.StringIO(data))
      assert len(pipeline.modules()) == 1
      module = pipeline.modules()[0]
      assert isinstance(
          module,
          cellprofiler.modules.measureobjectintensitydistribution.MeasureObjectIntensityDistribution,
      )
      assert (
          module.wants_zernikes
          == cellprofiler.modules.measureobjectintensitydistribution.Z_NONE
      )
      assert module.zernike_degree == 9
      assert len(module.images_list.value) == 2
      assert {"CropGreen", "CropRed"}.issubset(module.images_list.value)
      assert len(module.objects) == 2
      for group, (
          object_name,
          center_choice,
          center_object_name,
      ) in zip(
          module.objects,
          (
              (
                  "Nuclei",
                  cellprofiler.modules.measureobjectintensitydistribution.C_SELF,
                  "Ichthyosaurs",
              ),
              (
                  "Cells",
                  cellprofiler.modules.measureobjectintensitydistribution.C_EDGES_OF_OTHER,
                  "Nuclei",
              ),
          ),
      ):
          assert group.object_name.value == object_name
          assert group.center_choice.value == center_choice
          assert group.center_object_name == center_object_name
      assert len(module.bin_counts) == 2
      for group, (bin_count, scale, max_radius) in zip(
          module.bin_counts, ((5, True, 100), (4, False, 100))
      ):
          assert group.wants_scaled == scale
          assert group.bin_count == bin_count
          assert group.maximum_radius == max_radius
      for (
          group,
          (
              image_name,
              object_name,
              bin_count,
              measurement,
              colormap,
              wants_to_save,
              output_image_name,
          ),
      ) in zip(
          module.heatmaps,
          (
              (
                  "CropRed",
                  "Cells",
                  5,
                  cellprofiler.modules.measureobjectintensitydistribution.A_FRAC_AT_D,
                  "Default",
                  True,
                  "Heat",
              ),
              (
                  "CropGreen",
                  "Nuclei",
                  4,
                  cellprofiler.modules.measureobjectintensitydistribution.A_MEAN_FRAC,
                  "Spectral",
                  False,
                  "A",
              ),
              (
                  "CropRed",
                  "Nuclei",
                  5,
                  cellprofiler.modules.measureobjectintensitydistribution.A_RADIAL_CV,
                  "Default",
                  False,
                  "B",
              ),
          ),
      ):
          assert group.image_name.value == image_name
          assert group.object_name.value == object_name
          assert int(group.bin_count.value) == bin_count
          assert group.measurement == measurement
          assert group.colormap == colormap
          assert group.wants_to_save_display == wants_to_save
          assert group.display_name == output_image_name
  
imports: import io
  import centrosome.propagate
  import numpy
  import scipy.stats
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.module
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  import cellprofiler.modules.measureobjectintensitydistribution
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 7 for calling a global function with example usage: test_load_v4() without return types