<s> def sort ( list ) : <EOL> return sorted ( list ) <EOL> def config_template_name ( config_template_id , config_templates ) : <EOL> if config_template_id in config_templates : <EOL> return config_templates [ config_template_id ] <EOL> else : <EOL> return '<STR_LIT>' <EOL> def all_job_data ( jobs , job_type ) : <EOL> """<STR_LIT>""" <EOL> conf_tmpl_ids = [ ] <EOL> for job in jobs : <EOL> for jt , data in job . iteritems ( ) : <EOL> if jt == job_type : <EOL> if data [ '<STR_LIT>' ] not in conf_tmpl_ids : <EOL> conf_tmpl_ids . append ( data [ '<STR_LIT>' ] ) <EOL> yield data <EOL> def job_data_for_type ( jobs , job_type ) : <EOL> """<STR_LIT>""" <EOL> for job in jobs : <EOL> for jt , data in job . iteritems ( ) : <EOL> if jt == job_type : <EOL> return data <EOL> def fail_status ( job_data , token ) : <EOL> """<STR_LIT>""" <EOL> output = '<STR_LIT>' <EOL> if job_data [ '<STR_LIT:status>' ] in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] : <EOL> color = '<STR_LIT>' <EOL> elif job_data [ '<STR_LIT:status>' ] == '<STR_LIT>' : <EOL> color = '<STR_LIT>' <EOL> else : <EOL> color = '<STR_LIT>' <EOL> return output % ( color , token ) <EOL> def review_feedback ( mp ) : <EOL> return '<STR_LIT>' . join ( mp . feedback ) <EOL> def review_score ( mp ) : <EOL> return '<STR_LIT>' . join ( mp . reason ) <EOL> def display_feedback ( mp ) : <EOL> if mp . lowest_feedback is None or mp . highest_feedback is None : <EOL> return '<STR_LIT>' <EOL> if mp . lowest_feedback > <NUM_LIT:0> : <EOL> report_value = mp . highest_feedback <EOL> color = '<STR_LIT>' <EOL> else : <EOL> report_value = mp . lowest_feedback <EOL> color = '<STR_LIT>' <EOL> return '<STR_LIT>' % ( color , report_value ) </s>
