code: def test_load_v3():
      pipeline_file = os.path.join(
          get_data_directory(), "modules/metadata/v3.pipeline"
      )
      with open(pipeline_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_core.modules.metadata.Metadata
      )
      assert module.wants_metadata
      assert (
          module.data_type_choice
          == cellprofiler_core.constants.modules.metadata.DTC_TEXT
      )
      assert len(module.extraction_methods) == 2
      em0, em1 = module.extraction_methods
      assert (
          em0.extraction_method
          == cellprofiler_core.constants.modules.metadata.X_MANUAL_EXTRACTION
      )
      assert (
          em0.source
          == cellprofiler_core.constants.modules.metadata.XM_FILE_NAME
      )
      assert (
          em0.file_regexp.value
          == r"^Channel(?P<ChannelNumber>[12])-(?P<Index>[0-9]+)-(?P<WellRow>[A-H])-(?P<WellColumn>[0-9]{2}).tif$"
      )
      assert (
          em0.folder_regexp.value
          == r"(?P<Date>[0-9]{4}_[0-9]{2}_[0-9]{2})$"
      )
      assert (
          em0.filter_choice
          == cellprofiler_core.constants.modules.metadata.F_ALL_IMAGES
      )
      assert em0.filter == 'or (file does contain "Channel2")'
      assert not em0.wants_case_insensitive
  
      assert (
          em1.extraction_method
          == cellprofiler_core.constants.modules.metadata.X_IMPORTED_EXTRACTION
      )
      assert (
          em1.source
          == cellprofiler_core.constants.modules.metadata.XM_FOLDER_NAME
      )
      assert (
          em1.filter_choice
          == cellprofiler_core.constants.modules.metadata.F_FILTERED_IMAGES
      )
      assert (
          em1.csv_location.get_dir_choice()
          == cellprofiler_core.preferences.ABSOLUTE_FOLDER_NAME
      )
      assert em1.csv_location.get_custom_path() == "/imaging/analysis"
      assert em1.csv_filename.value == "metadata.csv"
      assert (
          em1.csv_joiner.value
          == "[{'Image Metadata': u'ChannelNumber', 'CSV Metadata': u'Wavelength'}]"
      )
      assert em1.wants_case_insensitive
  
imports: import io
  import json
  import os
  import tempfile
  import cellprofiler_core.constants.measurement
  import cellprofiler_core.constants.modules.images
  import cellprofiler_core.constants.modules.metadata
  import cellprofiler_core.measurement
  import cellprofiler_core.modules.images
  import cellprofiler_core.modules.metadata
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import tests.core
label_desc: Use image node_id 4 for calling a global function with example usage: test_load_v3() without return types