<s> from queue import Queue <EOL> class Counter ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , start = <NUM_LIT:0> , step = <NUM_LIT:1> ) : <EOL> self . _step = step <EOL> self . _counter = Queue ( maxsize = <NUM_LIT:1> ) <EOL> self . _counter . put ( start ) <EOL> def increment ( self ) : <EOL> return self . _change_current_value ( self . _step ) <EOL> def decrement ( self ) : <EOL> return self . _change_current_value ( - self . _step ) <EOL> def value ( self ) : <EOL> return self . _change_current_value ( <NUM_LIT:0> ) <EOL> def _change_current_value ( self , delta ) : <EOL> i = self . _counter . get ( ) <EOL> self . _counter . put ( i + delta ) <EOL> return i + delta </s>
