def get_block(name, data, newline="<STR_LIT:\n>"):
lines = itertools.dropwhile(not_eq(BLOCK_START % name), data)<EOL>gen = itertools.takewhile(not_eq(BLOCK_END % name), tail(lines))<EOL>return gen if newline is None else newline.join(gen)<EOL>
First block in a list of one line strings containing
reStructuredText data. The result is as a joined string with the
given newline, or a line generator if it's None. The
BLOCK_START and BLOCK_END delimiters are selected with the given
name and aren't included in the result.