#NEWLINE# def _startserver( self ) : #NEWLINE# #INDENT# if preexec_fn . start_server : #NEWLINE# #INDENT# def preexec_fn( ) : #NEWLINE# #INDENT# 'Prevents the server from dying on training interrupt.' #NEWLINE# signal . signal ( signal . SIGINT , signal . SIG_IGN ) #NEWLINE# #UNINDENT# logger . info ( 'Starting plotting server on localhost:5006' ) #NEWLINE# self . sub = Popen ( 'bokeh-server --ip 0.0.0.0 --backend memory' . split ( ) , stdout = PIPE , stderr = PIPE , preexec_fn = preexec_fn ) #NEWLINE# time . sleep ( 2 ) #NEWLINE# logger . info ( 'Plotting server PID: {}' . format ( self . sub . pid ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . sub = None #NEWLINE# #UNINDENT# output_server ( self . document , url = self . server_url )