boolean (PsiElement element) { PyFunction containingMethod = PsiTreeUtil.getParentOfType(element, PyFunction.class, false, PyClass.class); if (containingMethod != null) { final PyFunction.Modifier modifier = containingMethod.getModifier(); return modifier == PyFunction.Modifier.STATICMETHOD; } return false; }