<s> from math import pi <EOL> import pandas as pd <EOL> from bokeh . plotting import figure , show , output_file <EOL> from bokeh . sampledata . stocks import MSFT <EOL> df = pd . DataFrame ( MSFT ) [ : <NUM_LIT:50> ] <EOL> df [ "<STR_LIT:date>" ] = pd . to_datetime ( df [ "<STR_LIT:date>" ] ) <EOL> mids = ( df . open + df . close ) / <NUM_LIT:2> <EOL> spans = abs ( df . close - df . open ) <EOL> inc = df . close > df . open <EOL> dec = df . open > df . close <EOL> w = <NUM_LIT:12> * <NUM_LIT> * <NUM_LIT> * <NUM_LIT:1000> <EOL> TOOLS = "<STR_LIT>" <EOL> p = figure ( x_axis_type = "<STR_LIT>" , tools = TOOLS , plot_width = <NUM_LIT:1000> , toolbar_location = "<STR_LIT:left>" ) <EOL> p . title = "<STR_LIT>" <EOL> p . xaxis . major_label_orientation = pi / <NUM_LIT:4> <EOL> p . grid . grid_line_alpha = <NUM_LIT> <EOL> p . segment ( df . date , df . high , df . date , df . low , color = "<STR_LIT>" ) <EOL> p . rect ( df . date [ inc ] , mids [ inc ] , w , spans [ inc ] , fill_color = "<STR_LIT>" , line_color = "<STR_LIT>" ) <EOL> p . rect ( df . date [ dec ] , mids [ dec ] , w , spans [ dec ] , fill_color = "<STR_LIT>" , line_color = "<STR_LIT>" ) <EOL> output_file ( "<STR_LIT>" , title = "<STR_LIT>" ) <EOL> show ( p ) </s>
