#NEWLINE# def __prn_func( self , text , nl = True ) : #NEWLINE# #INDENT# '! Prints and flushes data to stdout ' #NEWLINE# with self . __prn_lock : #NEWLINE# #INDENT# if ( nl and ( not text . endswith ( '\n' ) ) ) : #NEWLINE# #INDENT# text += '\n' #NEWLINE# #UNINDENT# sys . stdout . write ( text ) #NEWLINE# sys . stdout . flush ( )