@contextmanager<EOL><INDENT>def block(<EOL>self,<EOL>before='<STR_LIT>',         <EOL>after='<STR_LIT>',          <EOL>delim=('<STR_LIT:{>', '<STR_LIT:}>'),  <EOL>dent=None,         <EOL>allman=False       <EOL>):<EOL><DEDENT>
assert len(delim) == <NUM_LIT:2>, '<STR_LIT>'<EOL>assert (isinstance(delim[<NUM_LIT:0>], (six.text_type, type(None))) and<EOL>isinstance(delim[<NUM_LIT:1>], (six.text_type, type(None)))), (<EOL>'<STR_LIT>')<EOL>if before and not allman:<EOL><INDENT>if delim[<NUM_LIT:0>] is not None:<EOL><INDENT>self.emit('<STR_LIT>'.format(before, delim[<NUM_LIT:0>]))<EOL><DEDENT>else:<EOL><INDENT>self.emit(before)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if before:<EOL><INDENT>self.emit(before)<EOL><DEDENT>if delim[<NUM_LIT:0>] is not None:<EOL><INDENT>self.emit(delim[<NUM_LIT:0>])<EOL><DEDENT><DEDENT>with self.indent(dent):<EOL><INDENT>yield<EOL><DEDENT>if delim[<NUM_LIT:1>] is not None:<EOL><INDENT>self.emit(delim[<NUM_LIT:1>] + after)<EOL><DEDENT>else:<EOL><INDENT>self.emit(after)<EOL><DEDENT>
A context manager that emits configurable lines before and after an
indented block of text.

This is convenient for class and function definitions in some
languages.

Args:
    before (str): The string to be output in the first line which is
        not indented..
    after (str): The string to be output in the last line which is
        not indented.
    delim (str, str): The first element is added immediately following
        `before` and a space. The second element is added prior to a
        space and then `after`.
    dent (int): The amount to indent the block. If none, the default
        indentation increment is used (four spaces or one tab).
    allman (bool): Indicates whether to use `Allman` style indentation,
        or the default `K&R` style. If there is no `before` string this
        is ignored. For more details about indent styles see
        http://en.wikipedia.org/wiki/Indent_style