<s> class Priority ( object ) : <EOL> """<STR_LIT>""" <EOL> default_step = <NUM_LIT:100> <EOL> def __init__ ( self , step = default_step ) : <EOL> self . _step = step <EOL> self . _priority = <NUM_LIT:0> <EOL> def next ( self ) : <EOL> self . _priority += self . _step <EOL> return self . _priority <EOL> @ property <EOL> def current ( self ) : <EOL> return self . _priority <EOL> class PriorityStrategy ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . _priority = Priority ( ) <EOL> def one_by_one ( self , tasks ) : <EOL> """<STR_LIT>""" <EOL> for t in tasks : <EOL> t [ '<STR_LIT>' ] = self . _priority . next ( ) <EOL> def in_parallel ( self , tasks ) : <EOL> """<STR_LIT>""" <EOL> self . _priority . next ( ) <EOL> for t in tasks : <EOL> t [ '<STR_LIT>' ] = self . _priority . current <EOL> def in_parallel_by ( self , tasks , amount ) : <EOL> """<STR_LIT>""" <EOL> for index , task in enumerate ( tasks ) : <EOL> if index % amount == <NUM_LIT:0> : <EOL> self . _priority . next ( ) <EOL> task [ '<STR_LIT>' ] = self . _priority . current </s>
