def unregister_task(self, task):
    'Unregister a function with worker'
    self.worker_abilities.pop(task, None)
    self._update_initial_state()
    for command_handler in self.handler_to_connection_map.keys():
        command_handler.set_abilities(self.handler_initial_state['abilities'])
    return task
Unregister a function with worker
def unregister_task(self, task):
    
    self.worker_abilities.pop(task, None)
    self._update_initial_state()
    for command_handler in self.handler_to_connection_map.keys():
        command_handler.set_abilities(self.handler_initial_state['abilities'])
    return task