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: Update the name for a model.
  
  .. note::
      This function and the internal name mapping exist to support
      optimizing the common case of name lookup for models. Keeping a
      dedicated name index is faster than using generic ``bokeh.query``
      functions with a name selector
  
  Args:
      model (Model) : a model to update the name for
  
      old_name(str, None) : a previous name for the model, or None
  
      new_name(str, None) : a new name for the model, or None
  
  Returns:
      None
docstr_tok: ["Update","the","name","for","a","model",".","..","note",":",":","This","function","and","the","internal","name","mapping","exist","to","support","optimizing","the","common","case","of","name","lookup","for","models",".","Keeping","a","dedicated","name","index","is","faster","than","using","generic","``","bokeh.query","``","functions","with","a","name","selector","Args",":","model","(","Model",")",":","a","model","to","update","the","name","for","old_name","(","str",",","None",")",":","a","previous","name","for","the","model",",","or","None","new_name","(","str",",","None",")",":","a","new","name","for","the","model",",","or","None","Returns",":","None"]
code: def update_name(
      self, model: Model, old_name: str | None, new_name: str | None
  ) -> None:
      """Update the name for a model.
  
      .. note::
          This function and the internal name mapping exist to support
          optimizing the common case of name lookup for models. Keeping a
          dedicated name index is faster than using generic ``bokeh.query``
          functions with a name selector
  
      Args:
          model (Model) : a model to update the name for
  
          old_name(str, None) : a previous name for the model, or None
  
          new_name(str, None) : a new name for the model, or None
  
      Returns:
          None
  
      """
      if old_name is not None:
          self._models_by_name.remove_value(old_name, model)
      if new_name is not None:
          self._models_by_name.add_value(new_name, model)
  
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 17 for calling the DocumentModelManager obj's underlying member method code with example usage: obj.update_name(model, old_name, new_name) without return types