boolean (PyClass node) { final String[] contextManagerFunctionNames = {PyNames.ENTER, PyNames.EXIT}; for (String name : contextManagerFunctionNames) { if (node.findMethodByName(name, false, myTypeEvalContext) == null) { return false; } } return true; }