List<PsiElement> (@NotNull ResolveModuleParams params) { final QualifiedName qualifiedName = params.getName(); final int relativeLevel = params.getLevel(); final PsiFile sourceFile = params.getFile(); final boolean importIsAbsolute = params.isAbsolute(); return ObjectUtils.notNull( RecursionManager.doPreventingRecursion( params, false, () -> { final PyQualifiedNameResolveContext initialContext = PyResolveImportUtil.fromFoothold(sourceFile); final PyQualifiedNameResolveContext context = relativeLevel > 0 ? initialContext.copyWithRelative(relativeLevel).copyWithoutRoots() : importIsAbsolute ? initialContext : initialContext.copyWithRelative(0); return PyResolveImportUtil.resolveQualifiedName(qualifiedName, context); } ), Collections.emptyList() ); }