code: def stack_pop(self, key):
          
          task = Task.current_task()
          try:
              context = task._context_stack
          except AttributeError:
              raise KeyError('pop from empty stack') from None
          value = context[key]
          stack_value = value.pop()
          if not value:
              context.pop(key)
          return stack_value
docs: Remove a value in a task context stack