void (@NotNull PyReturnStatement node) { if (ContainerUtil.exists(myVersionsToProcess, level -> level.isPython2() && registerForLanguageLevel(level))) { final PyFunction function = PsiTreeUtil.getParentOfType(node, PyFunction.class, false, PyClass.class); if (function != null && node.getExpression() != null) { final YieldVisitor visitor = new YieldVisitor(); function.acceptChildren(visitor); if (visitor.haveYield()) { registerProblem(node, PyPsiBundle.message("INSP.compatibility.pre35.versions.do.not.allow.return.with.argument.inside.generator")); } } } }