code: def test_load_v2():
      file = tests.frontend.modules.get_test_resources_directory(
          "correctilluminationcalculate/v2.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(StringIO(data))
      assert len(pipeline.modules()) == 5
      module = pipeline.modules()[0]
      assert isinstance(
          module,
          cellprofiler.modules.correctilluminationcalculate.CorrectIlluminationCalculate,
      )
      assert module.image_name == "Masked"
      assert module.illumination_image_name == "Illum"
      assert (
          module.intensity_choice
          == cellprofiler.modules.correctilluminationcalculate.IC_BACKGROUND
      )
      assert not module.dilate_objects
      assert module.object_dilation_radius == 2
      assert module.block_size == 55
      assert module.rescale_option == "No"
      assert (
          module.each_or_all
          == cellprofiler.modules.correctilluminationcalculate.EA_EACH
      )
      assert (
          module.smoothing_method
          == cellprofiler.modules.correctilluminationcalculate.SM_SPLINES
      )
      assert (
          module.automatic_object_width
          == cellprofiler.modules.correctilluminationcalculate.FI_AUTOMATIC
      )
      assert module.object_width == 11
      assert module.size_of_smoothing_filter == 12
      assert not module.save_average_image
      assert module.average_image_name == "IllumAverage"
      assert not module.save_dilated_image
      assert module.dilated_image_name == "IllumDilated"
      assert not module.automatic_splines
      assert module.spline_bg_mode == MODE_BRIGHT
      assert module.spline_points == 4
      assert module.spline_threshold == 2
      assert module.spline_rescale == 2
      assert module.spline_maximum_iterations == 40
      assert round(abs(module.spline_convergence.value - 0.001), 7) == 0
  
      assert pipeline.modules()[1].automatic_splines
  
      for module, spline_bg_mode in zip(
          pipeline.modules()[1:4],
          (
              MODE_AUTO,
              MODE_DARK,
              MODE_GRAY,
          ),
      ):
          assert isinstance(
              module,
              cellprofiler.modules.correctilluminationcalculate.CorrectIlluminationCalculate,
          )
          assert module.spline_bg_mode == spline_bg_mode
  
      module = pipeline.modules()[4]
      assert (
          module.smoothing_method
          == cellprofiler.modules.correctilluminationcalculate.SM_CONVEX_HULL
      )
  
imports: import numpy
  import pytest
  from centrosome.bg_compensate import MODE_AUTO, MODE_BRIGHT, MODE_DARK, MODE_GRAY
  from six.moves import StringIO
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler.modules.correctilluminationcalculate
  import cellprofiler_core.modules.injectimage
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 21 for calling a global function with example usage: test_load_v2() without return types