'Pull the server\'s state and set it as session.document.
If this is called more than once, session.document will
be the same object instance but its contents will be overwritten.
Automatically calls :func:`connect` before pulling.'

def pull(self):

    self.connect()
    if (not self._connection.connected):
        raise IOError("Cannot    pull    session    document    because    we    failed    to    connect    to    the    server    (to    start    the    server,    try    the    'bokeh    serve'    command)")
    if (self._document is None):
        doc = Document()
    else:
        doc = self._document
    self._connection.pull_doc(doc)
    if (self._document is None):
        self._attach_document(doc)
