#NEWLINE# @ classmethod #NEWLINE# def from_config( cls , config , name , section_key = 'scorer_models' ) : #NEWLINE# #INDENT# '\n        Constructs a model from configuration.\n        ' #NEWLINE# section = config [ config ] [ name ] #NEWLINE# if ( 'model_file' in section ) : #NEWLINE# #INDENT# return cls . load ( open ( section [ 'model_file' ] , 'rb' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return cls ( ** { k : v for ( k , v ) in section . items ( ) if ( k != 'class' ) } )