def _pop_comment_block(self, statements, header_re):
res = []<EOL>comments = []<EOL>match = None<EOL>st_iter = iter(statements)<EOL>for st in st_iter:<EOL><INDENT>if isinstance(st, ast.Comment):<EOL><INDENT>match = header_re.match(st.text)<EOL>if match:<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>res.append(st)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>res.append(st)<EOL><DEDENT><DEDENT>for st in st_iter:<EOL><INDENT>if isinstance(st, ast.Comment):<EOL><INDENT>comments.append(st)<EOL><DEDENT>else:<EOL><INDENT>res.append(st)<EOL>break<EOL><DEDENT><DEDENT>res.extend(list(st_iter))<EOL>return match, dedent("<STR_LIT>".join(c.text[<NUM_LIT:1>:] + "<STR_LIT:\n>" for c in comments)), res<EOL>
Look for a series of comments that start with one that matches the
        regex. If the first comment is found, all subsequent comments are
        popped from statements, concatenated and dedented and returned.