"""
    DAG context is used to keep the current DAG when DAG is used as ContextManager.
    You can use DAG as context:
    .. code-block:: python
        with DAG(
            dag_id="example_dag",
            default_args=default_args,
            schedule="0 0 * * *",
            dagrun_timeout=timedelta(minutes=60),
        ) as dag:
            ...
    If you do this the context stores the DAG and whenever new task is created, it will use
    such stored DAG as the parent DAG.
    """
    _context_managed_dags: Deque[DAG] = deque()
    autoregistered_dags: set[tuple[DAG, ModuleType]] = set()
    current_autoregister_module_name: str | None = None
    @classmethod
    def push_context_managed_dag(cls, dag: DAG):