#NEWLINE# def get_old_happy_unhappy_draining_tasks_for_app( app , drain_method , service , nerve_ns , bounce_health_params , system_paasta_config ) : #NEWLINE# #INDENT# tasks_by_state = { #NEWLINE# #INDENT# 'happy' : set ( ) , #NEWLINE# 'unhappy' : set ( ) , #NEWLINE# 'draining' : set ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# happy_tasks = bounce_lib . get_happy_tasks ( app , service , nerve_ns , system_paasta_config , ** bounce_health_params ) #NEWLINE# for task in app . tasks : #NEWLINE# #INDENT# if drain_method . is_draining ( task ) : #NEWLINE# #INDENT# state = 'draining' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( task in happy_tasks ) : #NEWLINE# #INDENT# state = 'happy' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# state = 'unhappy' #NEWLINE# #UNINDENT# #UNINDENT# tasks_by_state [ state ] . add ( task ) #NEWLINE# #UNINDENT# return tasks_by_state