def task_accepted(request, _all_total_count=all_total_count, add_active_request=active_requests.add, add_to_total_count=total_count.update):
 add_active_request(request)
 add_to_total_count({request.name: 1})
 all_total_count[0] += 1

def task_accepted ( request , _all_total_count = all_total_count , add_active_request = active_requests . add , add_to_total_count = total_count . update ) : add_active_request ( request ) add_to_total_count ( { request . name : 1 } ) all_total_count [ 0 ] += 1
update global state when a task has been accepted .