code: def test_load_v2():
      file = tests.frontend.modules.get_test_resources_directory(
          "straightenworms/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()) == 3
      for alignment, module in zip(
          (
              cellprofiler.modules.straightenworms.FLIP_TOP,
              cellprofiler.modules.straightenworms.FLIP_BOTTOM,
              cellprofiler.modules.straightenworms.FLIP_NONE,
          ),
          pipeline.modules(),
      ):
          assert isinstance(
              module,
              cellprofiler.modules.straightenworms.StraightenWorms,
          )
          assert module.objects_name == "OverlappingWorms"
          assert module.straightened_objects_name == "StraightenedWorms"
          assert module.width == 20
          assert (
              module.training_set_directory.dir_choice
              == cellprofiler_core.preferences.DEFAULT_INPUT_FOLDER_NAME
          )
          assert module.training_set_file_name == "TrainingSet.mat"
          assert len(module.images) == 1
          assert module.wants_measurements
          assert module.number_of_segments == 4
          assert module.number_of_stripes == 1
          assert module.flip_worms == alignment
          assert module.flip_image == "Brightfield"
          assert module.images[0].image_name == "Brightfield"
          assert (
              module.images[0].straightened_image_name
              == "StraightenedImage"
          )
  
imports: import centrosome.cpmorphology
  import numpy
  import six.moves
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.modules
  from cellprofiler_core.constants.measurement import C_COUNT, M_LOCATION_CENTER_X, M_LOCATION_CENTER_Y, M_NUMBER_OBJECT_NUMBER, C_LOCATION, C_NUMBER, FTR_CENTER_X, FTR_CENTER_Y, FTR_OBJECT_NUMBER, COLTYPE_FLOAT
  import cellprofiler.modules.straightenworms
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import cellprofiler_core.preferences
  import tests.frontend.modules
label_desc: Use image node_id 2 for calling a global function with example usage: test_load_v2() without return types