#NEWLINE# def trim_docstring( docstring ) : #NEWLINE# #INDENT# 'Copied from PEP 257: http://www.python.org/dev/peps/pep-0257/' #NEWLINE# if ( not docstring ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# lines = docstring . expandtabs ( ) . splitlines ( ) #NEWLINE# indent = sys . maxint #NEWLINE# for line in lines [ 1 : ] : #NEWLINE# #INDENT# stripped = line . lstrip ( ) #NEWLINE# if stripped : #NEWLINE# #INDENT# indent = min ( indent , ( len ( line ) - len ( stripped ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# trimmed = [ lines [ 0 ] . strip ( ) ] #NEWLINE# if ( indent < sys . maxint ) : #NEWLINE# #INDENT# for line in lines [ 1 : ] : #NEWLINE# #INDENT# trimmed . append ( line [ indent : ] . rstrip ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# while ( trimmed and ( not trimmed [ ( - 1 ) ] ) ) : #NEWLINE# #INDENT# trimmed . pop ( ) #NEWLINE# #UNINDENT# while ( trimmed and ( not trimmed [ 0 ] ) ) : #NEWLINE# #INDENT# trimmed . pop ( 0 ) #NEWLINE# #UNINDENT# return '\n' . join ( trimmed )