def notebook_div(model, notebook_comms_target=None):
 model = _check_one_model(model)
 with _ModelInEmptyDocument(model):
  (docs_json, render_items) = _standalone_docs_json_and_render_items([model])
 item = render_items[0]
 if notebook_comms_target:
  item['notebook_comms_target'] = notebook_comms_target
 else:
  notebook_comms_target = ''
 script = _wrap_in_onload(DOC_JS.render(docs_json=serialize_json(docs_json), render_items=serialize_json(render_items)))
 resources = EMPTY
 js = AUTOLOAD_NB_JS.render(comms_target=notebook_comms_target, js_urls=resources.js_files, css_urls=resources.css_files, js_raw=(resources.js_raw + [script]), css_raw=resources.css_raw_str, elementid=item['elementid'])
 div = _div_for_render_item(item)
 html = NOTEBOOK_DIV.render(plot_script=js, plot_div=div)
 return encode_utf8(html)

def notebook_div ( model , notebook_comms_target = None ) : model = _check_one_model ( model ) with _ModelInEmptyDocument ( model ) : ( docs_json , render_items ) = _standalone_docs_json_and_render_items ( [ model ] ) item = render_items [ 0 ] if notebook_comms_target : item [ 'notebook_comms_target' ] = notebook_comms_target else : notebook_comms_target = '' script = _wrap_in_onload ( DOC_JS . render ( docs_json = serialize_json ( docs_json ) , render_items = serialize_json ( render_items ) ) ) resources = EMPTY js = AUTOLOAD_NB_JS . render ( comms_target = notebook_comms_target , js_urls = resources . js_files , css_urls = resources . css_files , js_raw = ( resources . js_raw + [ script ] ) , css_raw = resources . css_raw_str , elementid = item [ 'elementid' ] ) div = _div_for_render_item ( item ) html = NOTEBOOK_DIV . render ( plot_script = js , plot_div = div ) return encode_utf8 ( html )
return html for a div that will display a bokeh plot in an ipython notebook the data for the plot is stored directly in the returned html .