https://github.com/apache/airflow/blob/main/airflow/cli/commands/task_command.py#L145
"""
    Enum to signal manner of exit for task run command.
    :meta private:
    """
    DEFERRED = 100
    """When task exits with deferral to trigger."""
@contextlib.contextmanager
def set_current_context(context: Context) -> Generator[Context, None, None]:
    """
    Set the current execution context to the provided context object.
    This method should be called once per Task execution, before calling operator.execute.
    """
    _CURRENT_CONTEXT.append(context)
    try:
        yield context
    finally:
        expected_state = _CURRENT_CONTEXT.pop()
        if expected_state != context:
            log.warning(
                "Current context is not equal to the state at context stack. Expected=%s, got=%s",
                context,
                expected_state,
            )
def _stop_remaining_tasks(*, task_instance: TaskInstance | TaskInstancePydantic, session: Session):