<s> """<STR_LIT>""" <EOL> import sys <EOL> import time <EOL> import pyprind <EOL> n = <NUM_LIT:100> <EOL> sleeptime = <NUM_LIT> <EOL> def test_basic_percent ( ) : <EOL> perc = pyprind . ProgPercent ( n ) <EOL> for i in range ( n ) : <EOL> time . sleep ( sleeptime ) <EOL> perc . update ( ) <EOL> def test_stdout ( ) : <EOL> perc = pyprind . ProgPercent ( n , stream = sys . stdout ) <EOL> for i in range ( n ) : <EOL> time . sleep ( sleeptime ) <EOL> perc . update ( ) <EOL> def test_generator ( ) : <EOL> for i in pyprind . prog_percent ( range ( n ) , stream = sys . stdout ) : <EOL> time . sleep ( sleeptime ) <EOL> def test_monitoring ( ) : <EOL> perc = pyprind . ProgPercent ( n , monitor = True ) <EOL> for i in range ( n ) : <EOL> time . sleep ( sleeptime ) <EOL> perc . update ( ) <EOL> print ( perc ) <EOL> def test_item_tracking ( ) : <EOL> items = [ '<STR_LIT>' % i for i in range ( <NUM_LIT:0> , n ) ] <EOL> perc = pyprind . ProgPercent ( len ( items ) ) <EOL> for i in items : <EOL> time . sleep ( sleeptime ) <EOL> perc . update ( item_id = i ) <EOL> def test_force_flush ( ) : <EOL> perc = pyprind . ProgPercent ( n ) <EOL> for i in range ( n ) : <EOL> time . sleep ( sleeptime ) <EOL> perc . update ( force_flush = True ) <EOL> def test_update_interval ( ) : <EOL> perc = pyprind . ProgPercent ( n , update_interval = <NUM_LIT:4> ) <EOL> for i in range ( n ) : <EOL> time . sleep ( sleeptime ) <EOL> perc . update ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' ) <EOL> test_basic_percent ( ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' ) <EOL> test_stdout ( ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' ) <EOL> test_generator ( ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' ) <EOL> test_monitoring ( ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' ) <EOL> test_item_tracking ( ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' ) <EOL> test_force_flush ( ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' % ( <NUM_LIT> * '<STR_LIT:=>' ) ) <EOL> print ( '<STR_LIT>' ) <EOL> test_update_interval ( ) </s>
