'Push a document to the server, overwriting any existing server-side doc.
Args:
document : bokeh.document.Document
the Document to push to the server
Returns:
The server reply'

def push_doc(self, document):

    msg = self._protocol.create('PUSH-DOC', document)
    reply = self._send_message_wait_for_reply(msg)
    if (reply is None):
        raise RuntimeError('Connection    to    server    was    lost')
    elif (reply.header['msgtype'] == 'ERROR'):
        raise RuntimeError(('Failed    to    push    document:    ' + reply.content['text']))
    else:
        return reply
