class_docstr: A context whose scope is defined by DslContextManager in a pipeline DSL.
  
  While DslContextManager (e.g. Cond) is public API and used in a pipeline DSL
  to define a scope of the DslContext, underlying context is not visible to the
  public users.
  
  DslContext always belongs to a single _Registry (1:n relationship),
  and its id is unique among the registry (can be duplicated with a context
  from a different registry).
  
  DslContext is associated with BaseNodes that are defined within the context
  manager ("with" block) that has created the context. If the node is defined
  within the multiple context mangers, all active DslContexts are associated
  with the node (n:m relationship).
  
  DO NOT create and use DslContext directly. DslContext is expected to be only
  created from DslContextManager.create_context.
docstr: All ancestor DslContexts in parent -> child order.
docstr_tok: ["All","ancestor","DslContexts","in","parent","-",">","child","order","."]
code: def ancestors(self) -> Iterable["DslContext"]:
      """All ancestor DslContexts in parent -> child order."""
      if self.parent:
          parent = cast(DslContext, self.parent)
          yield from parent.ancestors
          yield parent
  
file_path: tfx/tfx/dsl/context_managers/dsl_context.py
imports: from typing import Any, Optional, Iterable, cast, Sequence
label_desc: Use image node_id 4 for calling the DslContext obj's underlying member method code with example usage: obj.ancestors() without return types