Set a value in a task context stack

def stack_push(self, key, value):
        """Set a value in a task context stack
        """
        task = Task.current_task()
        try:
            context = task._context_stack
        except AttributeError:
            task._context_stack = context = {}
        if key not in context:
            context[key] = []
        context[key].append(value)