boolean (@NotNull Problem problem, @NotNull PsiFile file, @Nullable Document document) { if (document == null) { return false; } final int reportedLine = problem.myLine - 1; final int lineLastOffset = Math.max(document.getLineStartOffset(reportedLine), document.getLineEndOffset(reportedLine) - 1); final PsiComment comment = as(file.findElementAt(lineLastOffset), PsiComment.class); if (comment != null) { final Set<String> codes = Flake8InspectionSuppressor.extractNoqaCodes(comment); if (codes != null) { return codes.isEmpty() || ContainerUtil.exists(codes, code -> problem.myCode.startsWith(code)); } } return false; }