PyElement (@NotNull final Property property) { final PyCallable getter = property.getGetter().valueOrNull(); final PyCallable setter = property.getSetter().valueOrNull(); final PyCallable deleter = property.getDeleter().valueOrNull(); if (getter != null) { return getter; } else if (setter != null) { return setter; } else if (deleter != null) { return deleter; } else { final PyTargetExpression site = property.getDefinitionSite(); assert site != null : "Property has no methods nor declaration. That is not property"; return site; } }