PsiElement (@NotNull PsiFile foothold, @NotNull String referencedName) { final PyQualifiedNameResolveContext context = PyResolveImportUtil.fromFoothold(foothold).copyWithoutRoots(); final List<PsiElement> results = PyResolveImportUtil.resolveQualifiedName(QualifiedName.fromDottedString(referencedName), context); return !results.isEmpty() ? results.get(0) : null; }