code: def _attach_document(self, doc):
          ''' Attach a model to a Bokeh |Document|.
  
          This private interface should only ever called by the Document
          implementation to set the private ._document field properly
  
          '''
          if self._document is not None and self._document is not doc:
              raise RuntimeError("Models must be owned by only a single document, %r is already in a doc" % (self))
          doc.theme.apply_to_model(self)
          self._document = doc
          self._update_event_callbacks(f _attach_document(self, doc):
          ''' Attach a model to a Bokeh |Document|.
  
          This private interface should only ever called by the Document
          implementation to set the private ._document field properly
  
          '''
          if self._document is not None and self._document is not doc:
              raise RuntimeError("Models must be owned by only a single document, %r is already in a doc" % (self))
          doc.theme.apply_to_model(self)
          self._document = doc
          self._update_event_callbacks()
docs: Attach a model to a Bokeh |Document|.
  
          This private interface should only ever called by the Document
          implementation to set the private ._document field properly