@check_for(Function)<EOL><INDENT>def check_no_blank_before(self, function, docstring):  <DEDENT>
if docstring:<EOL><INDENT>before, _, after = function.source.partition(docstring)<EOL>blanks_before = list(map(is_blank, before.split('<STR_LIT:\n>')[:-<NUM_LIT:1>]))<EOL>blanks_after = list(map(is_blank, after.split('<STR_LIT:\n>')[<NUM_LIT:1>:]))<EOL>blanks_before_count = sum(takewhile(bool, reversed(blanks_before)))<EOL>blanks_after_count = sum(takewhile(bool, blanks_after))<EOL>if blanks_before_count != <NUM_LIT:0>:<EOL><INDENT>yield violations.D201(blanks_before_count)<EOL><DEDENT>if not all(blanks_after) and blanks_after_count != <NUM_LIT:0>:<EOL><INDENT>yield violations.D202(blanks_after_count)<EOL><DEDENT><DEDENT>
D20{1,2}: No blank lines allowed around function/method docstring.

        There's no blank line either before or after the docstring.