class_docstr: Context manager for setup and teardown tasks.
docstr: Add task to context manager.
docstr_tok: ["Add","task","to","context","manager","."]
code: def add_task(task: AbstractOperator | PlainXComArg):
      """Add task to context manager."""
      from airflow.models.xcom_arg import PlainXComArg
  
      if not SetupTeardownContext.active:
          raise AirflowException(
              "Cannot add task to context outside the context manager."
          )
      if isinstance(task, PlainXComArg):
          task = task.operator
      SetupTeardownContext.update_context_map(task)
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, cast
  from airflow.exceptions import AirflowException
label_desc: Use image node_id 1 for calling the SetupTeardownContext obj's underlying member method code with example usage: obj.add_task(task) without return types