code: def get_dependencies_from_modules(module_iterator, base_path):
      dependencies = set()
      for modname, mod in module_iterator:
          # hasattr doesn't work with python extensions
          if getattr(mod, "__file__", None) and is_local_source(
              os.path.abspath(mod.__file__), modname, base_path
          ):
              continue
          if modname.startswith("_") or "." in modname:
              continue
  
          try:
              pdep = PackageDependency.create(mod)
              if pdep.version is not None:
                  dependencies.add(pdep)
          except AttributeError:
              pass
      return dependencies
  
imports: import functools
  import hashlib
  import os.path
  import re
  import sys
  from pathlib import Path
  import pkg_resources
  import sacred.optional
  from sacred import SETTINGS
  from sacred.utils import iter_prefixes
label_desc: Use image node_id 11 for calling a global function with example usage: get_dependencies_from_modules(module_iterator, base_path) and returns: dependencies