#NEWLINE# def dots( it , label = '' , hide = None , every = 1 ) : #NEWLINE# #INDENT# 'Progress iterator. Prints a dot for each item being iterated' #NEWLINE# count = 0 #NEWLINE# if ( not hide ) : #NEWLINE# #INDENT# STREAM . write ( label ) #NEWLINE# #UNINDENT# for ( i , item ) in enumerate ( it ) : #NEWLINE# #INDENT# if ( not hide ) : #NEWLINE# #INDENT# if ( ( i % every ) == 0 ) : #NEWLINE# #INDENT# STREAM . write ( DOTS_CHAR ) #NEWLINE# sys . stderr . flush ( ) #NEWLINE# #UNINDENT# #UNINDENT# count += 1 #NEWLINE# ( yield item ) #NEWLINE# #UNINDENT# STREAM . write ( '\n' ) #NEWLINE# STREAM . flush ( )