class_docstr: Context manager for setup/teardown tasks.
  
  :meta private:
docstr: Recursively go through the tasks downstream of the setup in the context manager.
  
  If found, update the _teardown_downstream_of_setup accordingly.
docstr_tok: ["Recursively","go","through","the","tasks","downstream","of","the","setup","in","the","context","manager",".","If","found",",","update","the","_teardown_downstream_of_setup","accordingly","."]
code: def _update_teardown_downstream(
      cls, operator: AbstractOperator | list[AbstractOperator]
  ):
      """
      Recursively go through the tasks downstream of the setup in the context manager.
  
      If found, update the _teardown_downstream_of_setup accordingly.
      """
      operator = operator[0] if isinstance(operator, list) else operator
  
      def _get_teardowns(tasks):
          teardowns = [i for i in tasks if i.is_teardown]
          if not teardowns:
              all_lists = [
                  task.downstream_list + task.upstream_list
                  for task in tasks
              ]
              new_list = [
                  x
                  for sublist in all_lists
                  for x in sublist
                  if (isinstance(operator, list) and x in operator)
                  or x != operator
              ]
              if not new_list:
                  return []
              return _get_teardowns(new_list)
          return teardowns
  
      teardowns = _get_teardowns(operator.downstream_list)
      teardown_task = cls._teardown_downstream_of_setup
      if teardown_task and teardown_task != teardowns:
          cls._previous_teardown_downstream_of_setup.append(
              cls._teardown_downstream_of_setup
          )
      cls._teardown_downstream_of_setup = teardowns
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, cast
  from airflow.exceptions import AirflowException
label_desc: Use image node_id 12 for calling the BaseSetupTeardownContext obj's underlying member method code with example usage: obj._update_teardown_downstream(cls, operator) and returns: teardowns, _get_teardowns, list