class_docstr: Registry for DslContexts and associated BaseNodes of a pipeline DSL.
  
  DslContextRegistry manages the active DslContexts, their orders, BaseNodes,
  and association between DslContext and BaseNodes during the pipeline DSL
  definition. DslContext and BaseNode always belong to exactly one
  DslContextRegistry (1:n relationship).
class_docstr_tok: ["Registry","for","DslContexts","and","associated","BaseNodes","of","a","pipeline","DSL",".","DslContextRegistry","manages","the","active","DslContexts",",","their","orders",",","BaseNodes",",","and","association","between","DslContext","and","BaseNodes","during","the","pipeline","DSL","definition",".","DslContext","and","BaseNode","always","belong","to","exactly","one","DslContextRegistry","(","1",":","n","relationship",")","."]
docstr: Finalize and make the instance immutable.
docstr_tok: ["Finalize","and","make","the","instance","immutable","."]
code: def finalize(self):
      """Finalize and make the instance immutable."""
      self._finalized = True
  
imports: import collections
  import contextlib
  import threading
  from typing import Any, List, Optional, Iterator
  from tfx.dsl.context_managers import dsl_context
label_desc: Use image node_id 6 for calling the DslContextRegistry obj's underlying member method code with example usage: obj.finalize() without return types