boolean (@NotNull String text) { final String[] lines = StringUtil.splitByLines(text, false); for (int i = 0; i < lines.length; i++) { final String line = lines[i]; if (NumpyDocString.SECTION_HEADER.matcher(line).matches() && i > 0) { @NonNls final String lineBefore = lines[i - 1]; if (SectionBasedDocString.SECTION_NAMES.contains(StringUtil.toLowerCase(lineBefore.trim()))) { return true; } } } return false; }