#NEWLINE# def visualize( profilers , file_path = None , show = True , save = True , **kwargs ) : #NEWLINE# #INDENT# 'Visualize the results of profiling in a bokeh plot.\n\n    If multiple profilers are passed in, the plots are stacked vertically.\n\n    Parameters\n    ----------\n    profilers : profiler or list\n        Profiler or list of profilers.\n    file_path : string, optional\n        Name of the plot output file.\n    show : boolean, optional\n        If True (default), the plot is opened in a browser.\n    save : boolean, optional\n        If True (default), the plot is saved to disk.\n    **kwargs\n        Other keyword arguments, passed to bokeh.figure. These will override\n        all defaults set by visualize.\n\n    Returns\n    -------\n    The completed bokeh plot object.\n    ' #NEWLINE# if ( not _state . _notebook ) : #NEWLINE# #INDENT# file_path = ( file_path or 'profile.html' ) #NEWLINE# bp . output_file ( file_path ) #NEWLINE# #UNINDENT# if ( not isinstance ( profilers , list ) ) : #NEWLINE# #INDENT# profilers = [ profilers ] #NEWLINE# #UNINDENT# figs = [ prof . _plot ( ** kwargs ) for prof in profilers ] #NEWLINE# if ( len ( figs ) == 1 ) : #NEWLINE# #INDENT# p = figs [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# top = figs [ 0 ] #NEWLINE# for f in file_path [ 1 : ] : #NEWLINE# #INDENT# f . x_range = top . x_range #NEWLINE# f . title = None #NEWLINE# f . min_border_top -= 30 #NEWLINE# f . plot_height -= 30 #NEWLINE# #UNINDENT# for f in figs [ : ( - 1 ) ] : #NEWLINE# #INDENT# f . xaxis . axis_label = None #NEWLINE# f . min_border_bottom -= 30 #NEWLINE# f . plot_height -= 30 #NEWLINE# #UNINDENT# for f in figs : #NEWLINE# #INDENT# f . min_border_left = 75 #NEWLINE# f . min_border_right = 75 #NEWLINE# #UNINDENT# p = bp . gridplot ( [ [ f ] for f in figs ] ) #NEWLINE# #UNINDENT# if show : #NEWLINE# #INDENT# bp . show ( p ) #NEWLINE# #UNINDENT# if ( file_path and save ) : #NEWLINE# #INDENT# bp . save ( p ) #NEWLINE# #UNINDENT# return p