def minify(drop_semi=True):
layout_handlers = {<EOL>OpenBlock: layout_handler_openbrace,<EOL>CloseBlock: layout_handler_closebrace,<EOL>EndStatement: layout_handler_semicolon,<EOL>Space: layout_handler_space_minimum,<EOL>OptionalSpace: layout_handler_space_minimum,<EOL>RequiredSpace: layout_handler_space_imply,<EOL>(Space, OpenBlock): layout_handler_openbrace,<EOL>(Space, EndStatement): layout_handler_semicolon,<EOL>(OptionalSpace, EndStatement): layout_handler_semicolon,<EOL>}<EOL>if drop_semi:<EOL><INDENT>layout_handlers.update({<EOL>EndStatement: layout_handler_semicolon_optional,<EOL>(OptionalSpace, EndStatement): layout_handler_semicolon_optional,<EOL>(EndStatement, CloseBlock): layout_handler_closebrace,<EOL>(EndStatement, Dedent): rule_handler_noop,<EOL>((OptionalSpace, EndStatement), CloseBlock):<EOL>layout_handler_closebrace,<EOL>})<EOL><DEDENT>def minify_rule():<EOL><INDENT>return {<EOL>'<STR_LIT>': layout_handlers,<EOL>'<STR_LIT>': {<EOL>Literal: deferrable_handler_literal_continuation,<EOL>},<EOL>}<EOL><DEDENT>return minify_rule<EOL>
Rules for minifying output.

Arguments:

drop_semi
    Drop semicolons whenever possible.  Note that if Dedent and
    OptionalNewline has a handler defined, it will stop final break
    statements from being resolved due to reliance on normalized
    resolution.