code: def test_load_v1():
      file = tests.frontend.modules.get_test_resources_directory(
          "straightenworms/v1.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.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_OUTPUT_FOLDER_NAME
      )
      assert module.training_set_file_name == "TrainingSet.xml"
      assert module.image_count.value == 2
      for group, input_name, output_name in (
          (module.images[0], "Brightfield", "StraightenedBrightfield"),
          (
              module.images[1],
              "Fluorescence",
              "StraightenedFluorescence",
          ),
      ):
          assert group.image_name == input_name
          assert group.straightened_image_name == output_name
  
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 1 for calling a global function with example usage: test_load_v1() without return types