code: def test_get_metadata_from_filename():
      module = cellprofiler_core.modules.metadata.Metadata()
      module.wants_metadata.value = True
      em = module.extraction_methods[0]
      em.filter_choice.value = (
          cellprofiler_core.constants.modules.metadata.F_ALL_IMAGES
      )
      em.extraction_method.value = (
          cellprofiler_core.constants.modules.metadata.X_MANUAL_EXTRACTION
      )
      em.source.value = (
          cellprofiler_core.constants.modules.metadata.XM_FILE_NAME
      )
      em.file_regexp.value = "^(?P<Plate>[^_]+)_(?P<Well>[A-H][0-9]{2})_s(?P<Site>[0-9])_w(?P<Wavelength>[0-9])"
      em.filter_choice.value = (
          cellprofiler_core.constants.modules.metadata.F_ALL_IMAGES
      )
      url = "file:/imaging/analysis/P-12345_B08_s5_w2.tif"
      check(
          module,
          url,
          [
              {
                  "Plate": "P-12345",
                  "Well": "B08",
                  "Site": "5",
                  "Wavelength": "2",
              }
          ],
          ("Plate", "Well", "Site", "Wavelength"),
      )
  
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 8 for calling a global function with example usage: test_get_metadata_from_filename() without return types