boolean (@Nullable PsiElement element) { final PyFunction function = as(element, PyFunction.class); if (function == null) return false; final String name = function.getName(); return (PyNames.INIT.equals(name) || PyNames.NEW.equals(name)) && function.getContainingClass() != null; }