Set a value in a task context stack

def stack_get(self, key):
        """Set a value in a task context stack
        """
        task = Task.current_task()
        try:
            context = task._context_stack
        except AttributeError:
            return
        if key in context:
            return context[key][-1]