code: def check(module, url, dd, keys=None):
      """Check that running the metadata module on a url generates the expected dictionary"""
      pipeline = cellprofiler_core.pipeline.Pipeline()
      imgs = cellprofiler_core.modules.images.Images()
      imgs.filter_choice.value = (
          cellprofiler_core.constants.modules.images.FILTER_CHOICE_NONE
      )
      imgs.module_num = 1
      pipeline.add_module(imgs)
      module.set_module_num(2)
      pipeline.add_module(module)
      pipeline.add_urls([url])
      m = cellprofiler_core.measurement.Measurements()
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline, module, None, None, m, None
      )
      file_list = workspace.file_list
      file_list.add_files_to_filelist([url])
      assert module.prepare_run(workspace)
      image_planes = pipeline.get_image_plane_list(workspace)
      assert len(image_planes) == len(dd)
      for d, plane in zip(dd, image_planes):
          assert d.items() <= plane.get_all_metadata().items()
      all_keys = list(pipeline.get_available_metadata_keys().keys())
      if keys is not None:
          for key in keys:
              assert key in all_keys
  
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 7 for calling a global function with example usage: check(module, url, dd, keys) without return types