<s> import os <EOL> import re <EOL> from wlauto import AndroidUiAutoBenchmark , Parameter <EOL> class Linpack ( AndroidUiAutoBenchmark ) : <EOL> name = '<STR_LIT>' <EOL> description = """<STR_LIT>""" <EOL> package = '<STR_LIT>' <EOL> activity = '<STR_LIT>' <EOL> summary_metrics = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> regex = re . compile ( r'<STR_LIT>' ) <EOL> parameters = [ <EOL> Parameter ( '<STR_LIT>' , default = None , <EOL> description = '<STR_LIT>' ) , <EOL> ] <EOL> def __init__ ( self , device , ** kwargs ) : <EOL> super ( Linpack , self ) . __init__ ( device , ** kwargs ) <EOL> if self . output_file is None : <EOL> self . output_file = os . path . join ( self . device . working_directory , '<STR_LIT>' ) <EOL> self . uiauto_params [ '<STR_LIT>' ] = self . output_file <EOL> def update_result ( self , context ) : <EOL> super ( Linpack , self ) . update_result ( context ) <EOL> with open ( self . logcat_log ) as fh : <EOL> for line in fh : <EOL> match = self . regex . search ( line ) <EOL> if match : <EOL> metric = '<STR_LIT>' + match . group ( '<STR_LIT:type>' ) <EOL> value = float ( match . group ( '<STR_LIT:value>' ) ) <EOL> context . result . add_metric ( metric , value , '<STR_LIT>' ) </s>
