code: def get_modules_containing_name(evaluator, modules, name):
      """
      Search a name in the directories of modules.
      """
  
      def check_directories(paths):
          for p in paths:
              if p is not None:
                  # We need abspath, because the seetings paths might not already
                  # have been converted to absolute paths.
                  d = os.path.dirname(os.path.abspath(p))
                  for file_name in os.listdir(d):
                      path = os.path.join(d, file_name)
                      if file_name.endswith(".py"):
                          yield path
  
      def check_fs(path):
          try:
              f = open(path, "rb")
          except FileNotFoundError:
              return
          with f:
              code = python_bytes_to_unicode(f.read(), errors="replace")
              if name in code:
                  e_sys_path = evaluator.get_sys_path()
                  import_names = sys_path.dotted_path_in_sys_path(
                      e_sys_path, path
                  )
                  module = _load_module(
                      evaluator,
                      path,
                      code,
                      sys_path=e_sys_path,
                      import_names=import_names,
                  )
                  return module
  
      # skip non python modules
      used_mod_paths = set()
      for m in modules:
          try:
              path = m.py__file__()
          except AttributeError:
              pass
          else:
              used_mod_paths.add(path)
          yield m
  
      if not settings.dynamic_params_for_other_modules:
          return
  
      additional = set(
          os.path.abspath(p)
          for p in settings.additional_dynamic_modules
      )
      # Check the directories of used modules.
      paths = (
          additional | set(check_directories(used_mod_paths))
      ) - used_mod_paths
  
      # Sort here to make issues less random.
      for p in sorted(paths):
          # make testing easier, sort it - same results on every interpreter
          m = check_fs(p)
          if m is not None and not isinstance(
              m, compiled.CompiledObject
          ):
              yield m
  
imports: import os
  from parso.python import tree
  from parso.tree import search_ancestor
  from parso import python_bytes_to_unicode
  from jedi._compatibility import FileNotFoundError, ImplicitNSInfo, force_unicode, unicode
  from jedi import debug
  from jedi import settings
  from jedi.parser_utils import get_cached_code_lines
  from jedi.evaluate import sys_path
  from jedi.evaluate import helpers
  from jedi.evaluate import compiled
  from jedi.evaluate import analysis
  from jedi.evaluate.utils import unite
  from jedi.evaluate.cache import evaluator_method_cache
  from jedi.evaluate.filters import AbstractNameDefinition
  from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS
label_desc: Use image node_id 5 for calling a global function with example usage: get_modules_containing_name(evaluator, modules, name) and returns: module