boolean (PyElement node, AutoImportQuickFix importFix) { // if the context doesn't look like a function call and we only found imports of functions, suggest auto-import // as a quickfix but no popup balloon (PY-2312) if (!isCall(node) && importFix.hasOnlyFunctions()) { return true; } // if we're in a class context and the class defines a variable with the same name, offer auto-import only as quickfix, // not as popup PyClass containingClass = PsiTreeUtil.getParentOfType(node, PyClass.class); if (containingClass != null && (containingClass.findMethodByName(importFix.getNameToImport(), true, null) != null || containingClass.findInstanceAttribute(importFix.getNameToImport(), true) != null)) { return true; } return false; }