#NEWLINE# @ blueprint . route ( '' , methods = [ 'GET' ] ) #NEWLINE# def index( ) : #NEWLINE# #INDENT# column_attrs = list ( get_column_attrs ( ) ) #NEWLINE# raw_jobs = [ j for j in scheduler . jobs . values ( ) if isinstance ( j , ModelJob ) ] #NEWLINE# column_types = [ ColumnType ( 'latest' , False , ( lambda outs : outs [ ( - 1 ) ] ) ) , ColumnType ( 'max' , True , ( lambda outs : max ( outs ) ) ) , ColumnType ( 'min' , True , ( lambda outs : min ( outs ) ) ) ] #NEWLINE# jobs = [ ] #NEWLINE# for rjob in raw_jobs : #NEWLINE# #INDENT# train_outs = rjob . train_task ( ) . train_outputs #NEWLINE# val_outs = rjob . train_task ( ) . val_outputs #NEWLINE# history = rjob . status_history #NEWLINE# keys = set ( ( train_outs . keys ( ) + val_outs . keys ( ) ) ) #NEWLINE# job_info = JobBasicInfo ( rjob . name ( ) , rjob . id ( ) , rjob . status , time_filters . print_time_diff_nosuffixes ( ( history [ ( - 1 ) ] [ 1 ] - history [ 0 ] [ 1 ] ) ) , rjob . train_task ( ) . framework_id ) #NEWLINE# job_attrs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for cattr in column_attrs : #NEWLINE# #INDENT# if ( cattr in train_outs ) : #NEWLINE# #INDENT# out_list = train_outs [ cattr ] . data #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( cattr in val_outs ) : #NEWLINE# #INDENT# out_list = val_outs [ cattr ] . data #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# job_attrs [ cattr ] = { ctype . name : ctype . find_from_list ( out_list ) for ctype in column_types } #NEWLINE# #UNINDENT# job = ( job_info , job_attrs ) #NEWLINE# jobs . append ( job ) #NEWLINE# #UNINDENT# attrs_and_labels = [ ] #NEWLINE# for cattr in column_attrs : #NEWLINE# #INDENT# for ctype in column_types : #NEWLINE# #INDENT# attrs_and_labels . append ( ( keys , ctype , ctype . label ( cattr ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return flask . render_template ( 'models/index.html' , jobs = jobs , attrs_and_labels = attrs_and_labels )