boolean (@NotNull PsiElement element) { if (element instanceof PyParameter) { PyFunction function = PsiTreeUtil.getParentOfType(element, PyFunction.class); return function != null && function.getContainingClass() != null; } return false; }