class_docstr: Manage and provide access to all of the models that belong to a Bokeh
  Document.
  
  The set of "all models" means specifically all the models reachable from
  references form a Document's roots.
class_docstr_tok: ["Manage","and","provide","access","to","all","of","the","models","that","belong","to","a","Bokeh","Document",".","The","set","of","``","all","models","''","means","specifically","all","the","models","reachable","from","references","form","a","Document","'s","roots","."]
docstr: Defer expensive model recompuation until intermediate updates are
  complete.
  
  Making updates to the model graph might trigger events that cause more
  updates. This context manager can be used to prevent expensive model
  recompuation from happening until all events have finished and the
  Document state is quiescent.
  
  Example:
  
  .. code-block:: python
  
      with models.freeze():
          # updates that might change the model graph, that might trigger
          # updates that change the model graph, etc. Recompuation will
          # happen once at the end.
docstr_tok: ["Defer","expensive","model","recompuation","until","intermediate","updates","are","complete",".","Making","updates","to","the","model","graph","might","trigger","events","that","cause","more","updates",".","This","context","manager","can","be","used","to","prevent","expensive","model","recompuation","from","happening","until","all","events","have","finished","and","the","Document","state","is","quiescent",".","Example",":","..","code-block",":",":","python","with","models.freeze","(",")",":","#","updates","that","might","change","the","model","graph",",","that","might","trigger","#","updates","that","change","the","model","graph",",","etc",".","Recompuation","will","#","happen","once","at","the","end","."]
code: def freeze(self) -> Generator[None, None, None]:
      """Defer expensive model recompuation until intermediate updates are
      complete.
  
      Making updates to the model graph might trigger events that cause more
      updates. This context manager can be used to prevent expensive model
      recompuation from happening until all events have finished and the
      Document state is quiescent.
  
      Example:
  
      .. code-block:: python
  
          with models.freeze():
              # updates that might change the model graph, that might trigger
              # updates that change the model graph, etc. Recompuation will
              # happen once at the end.
  
      """
      self._push_freeze()
      yield
      self._pop_freeze()
  
imports: from __future__ import annotations
  import logging
  import contextlib
  import weakref
  from typing import TYPE_CHECKING, Callable, Generator, Iterator
  from ..core.types import ID
  from ..model import Model
  from ..util.datatypes import MultiValuedDict
label_desc: Use image node_id 8 for calling the DocumentModelManager obj's underlying member method code with example usage: obj.freeze() without return types