#NEWLINE# def shrink( self , amount ) : #NEWLINE# #INDENT# 'Kill off worker threads (not below self.min).' #NEWLINE# for t in self . _threads : #NEWLINE# #INDENT# if ( not t . isAlive ( ) ) : #NEWLINE# #INDENT# self . _threads . remove ( t ) #NEWLINE# amount -= 1 #NEWLINE# #UNINDENT# #UNINDENT# n_extra = max ( ( len ( n . _threads ) - self . min ) , 0 ) #NEWLINE# n_to_remove = min ( amount , n_extra ) #NEWLINE# for n in range ( n_to_remove ) : #NEWLINE# #INDENT# self . _queue . put ( _SHUTDOWNREQUEST )