   logger.info("Will inject Bokeh script tag with params #{JSON.stringify(item)}")
 
 embed_items = (docs_json, render_items, websocket_url) ->
-  if websocket_url?
-    set_websocket_url(websocket_url)
-
   docs = {}
   for docid of docs_json
     docs[docid] = Document.from_json(docs_json[docid])

  )

# Replace element with a view of model_id from the given session
add_model_from_session = (element, model_id, session_id) ->
  promise = _get_session(session_id)
  promise.then(
    (session) ->
      model = session.document.get_model_by_id(model_id)

add_document_static = (element, doc, use_for_title) ->
  _.delay(-> _render_document_to_element($(element), doc, use_for_title))

# map { websocket url to map { session id to promise of ClientSession } }
_sessions = {}
_get_session = (websocket_url, session_id) ->
  if not websocket_url? or websocket_url == null
    throw new Error("Missing websocket_url")
  if websocket_url not of _sessions
    _sessions[websocket_url] = {}
  subsessions = _sessions[websocket_url]
  if session_id not of subsessions
    subsessions[session_id] = pull_session(websocket_url, session_id)

  subsessions[session_id]

# Fill element with the roots from session_id
add_document_from_session = (element, websocket_url, session_id, use_for_title) ->
  promise = _get_session(websocket_url, session_id)
  promise.then(
    (session) ->
      _render_document_to_element(element, session.document, use_for_title)
