code: def test_get_metadata_from_path():
      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_FOLDER_NAME
      )
      em.folder_regexp.value = r".*[/\\](?P<Plate>.+)$"
      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"}], ("Plate",))
  
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 9 for calling a global function with example usage: test_get_metadata_from_path() without return types