'Add a model as a root of this Document.
Any changes to this model (including to other models referred to
by it) will trigger ``on_change`` callbacks registered on this
document.
Args:
model (Model) :
The model to add as a root of this document.
setter (ClientSession or ServerSession or None, optional) :
This is used to prevent "boomerang" updates to Bokeh apps.
(default: None)
In the context of a Bokeh server application, incoming updates
to properties will be annotated with the session that is
doing the updating. This value is propagated through any
subsequent change notifications that the update triggers.
The session can compare the event setter to itself, and
suppress any updates that originate from itself.'

def add_root(self, model, setter=None):

    from .server.events import RootAddedEvent
    if (model in self._roots):
        return
    self._push_all_models_freeze()
    try:
        self._roots.append(model)
    finally:
        self._pop_all_models_freeze()
    self._trigger_on_change(RootAddedEvent(self, model, setter))
