<s> import random <EOL> from jinja2 import Template <EOL> from bokeh . embed import components <EOL> from bokeh . plotting import figure <EOL> from bokeh . resources import INLINE <EOL> from bokeh . util . browser import view <EOL> PLOT_OPTIONS = dict ( plot_width = <NUM_LIT> , plot_height = <NUM_LIT> ) <EOL> SCATTER_OPTIONS = dict ( size = <NUM_LIT:12> , alpha = <NUM_LIT:0.5> ) <EOL> data = lambda : [ random . choice ( [ i for i in range ( <NUM_LIT:100> ) ] ) for r in range ( <NUM_LIT:10> ) ] <EOL> red = figure ( responsive = True , tools = '<STR_LIT>' , ** PLOT_OPTIONS ) <EOL> red . scatter ( data ( ) , data ( ) , color = "<STR_LIT>" , ** SCATTER_OPTIONS ) <EOL> blue = figure ( responsive = False , tools = '<STR_LIT>' , ** PLOT_OPTIONS ) <EOL> blue . scatter ( data ( ) , data ( ) , color = "<STR_LIT>" , ** SCATTER_OPTIONS ) <EOL> green = figure ( responsive = True , tools = '<STR_LIT>' , ** PLOT_OPTIONS ) <EOL> green . scatter ( data ( ) , data ( ) , color = "<STR_LIT>" , ** SCATTER_OPTIONS ) <EOL> template = Template ( '''<STR_LIT>''' ) <EOL> resources = INLINE <EOL> js_resources = resources . render_js ( ) <EOL> css_resources = resources . render_css ( ) <EOL> script , div = components ( { '<STR_LIT>' : red , '<STR_LIT>' : blue , '<STR_LIT>' : green } ) <EOL> html = template . render ( js_resources = js_resources , <EOL> css_resources = css_resources , <EOL> plot_script = script , <EOL> plot_div = div ) <EOL> filename = '<STR_LIT>' <EOL> with open ( filename , '<STR_LIT:w>' ) as f : <EOL> f . write ( html ) <EOL> view ( filename ) </s>
