code: def gather_sources_and_dependencies(
      globs, save_git_info, base_dir=None
  ):
      """Scan the given globals for modules and return them as dependencies."""
      experiment_path, main = get_main_file(globs, save_git_info)
  
      base_dir = base_dir or experiment_path
  
      gather_sources = source_discovery_strategies[
          SETTINGS["DISCOVER_SOURCES"]
      ]
      sources = gather_sources(globs, base_dir, save_git_info)
      if main is not None:
          sources.add(main)
  
      gather_dependencies = dependency_discovery_strategies[
          SETTINGS["DISCOVER_DEPENDENCIES"]
      ]
      dependencies = gather_dependencies(globs, base_dir)
  
      if opt.has_numpy:
          # Add numpy as a dependency because it might be used for randomness
          dependencies.add(PackageDependency.create(opt.np))
  
      return main, sources, 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 18 for calling a global function with example usage: gather_sources_and_dependencies(globs, save_git_info, base_dir) and returns: main,  sources,  dependencies