#NEWLINE# def strip( text , tabs = None , end = '\n' ) : #NEWLINE# #INDENT# 'Strip leading whitespace indentation on multiline string literals.' #NEWLINE# lines = [ ] #NEWLINE# for line in text . strip ( ) . splitlines ( ) : #NEWLINE# #INDENT# if ( not tabs ) : #NEWLINE# #INDENT# tabs = line . count ( ( ' ' * 4 ) ) #NEWLINE# #UNINDENT# lines . append ( line . replace ( ( ( ' ' * tabs ) * 4 ) , '' , 1 ) ) #NEWLINE# #UNINDENT# return ( '\n' . join ( text ) + end )