code: def _resolve_names(definition_names, avoid_names=()):
      for name in definition_names:
          if name in avoid_names:
              # Avoiding recursions here, because goto on a module name lands
              # on the same module.
              continue
  
          if not isinstance(name, imports.SubModuleName):
              # SubModuleNames are not actually existing names but created
              # names when importing something like `import foo.bar.baz`.
              yield name
  
          if name.api_type == "module":
              for name in _resolve_names(name.goto(), definition_names):
                  yield name
  
imports: from jedi.evaluate import imports
  from jedi.evaluate.filters import TreeNameDefinition
  from jedi.evaluate.context import ModuleContext
label_desc: Use image node_id 1 for calling a global function with example usage: _resolve_names(definition_names, avoid_names) without return types