code: def test_load_v2():
      file = tests.frontend.modules.get_test_resources_directory(
          "colortogray/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(six.moves.StringIO(data))
      assert len(pipeline.modules()) == 1
      module = pipeline.modules()[0]
      assert isinstance(
          module, cellprofiler.modules.colortogray.ColorToGray
      )
      assert module.image_name == "DNA"
      assert (
          module.combine_or_split
          == cellprofiler.modules.colortogray.COMBINE
      )
      assert (
          module.rgb_or_channels
          == cellprofiler.modules.colortogray.CH_CHANNELS
      )
      assert module.grayscale_name == "OrigGrayw"
      assert module.red_contribution == 1
      assert module.green_contribution == 3
      assert module.blue_contribution == 5
      assert module.use_red
      assert module.use_green
      assert module.use_blue
      assert module.red_name == "OrigRedx"
      assert module.green_name == "OrigGreeny"
      assert module.blue_name == "OrigBluez"
      assert module.channel_count.value == 3
      assert module.channels[0].channel_choice.value == 1
      assert module.channels[1].channel_choice.value == 3
      assert module.channels[2].channel_choice.value == 2
      assert module.channels[0].contribution == 1
      assert module.channels[1].contribution == 2
      assert module.channels[2].contribution == 3
      assert module.channels[0].image_name == "RedChannel1"
      assert module.channels[1].image_name == "GreenChannel2"
      assert module.channels[2].image_name == "BlueChannel3"
  
imports: import numpy
  import pytest
  import six.moves
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler.modules.colortogray
  import cellprofiler_core.modules.injectimage
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 9 for calling a global function with example usage: test_load_v2() without return types