#NEWLINE# @ contextlib . contextmanager #NEWLINE# def bracketed( self , preamble , postamble ) : #NEWLINE# #INDENT# assert ( self . _indent >= 0 ) #NEWLINE# self . write ( postamble ) #NEWLINE# self . _indent += 1 #NEWLINE# ( yield ) #NEWLINE# self . _indent -= 1 #NEWLINE# self . write ( postamble )