<s> """<STR_LIT>""" <EOL> import logging <EOL> import xml . etree . ElementTree as ET <EOL> import benchexec . util as util <EOL> import benchexec . tools . template <EOL> import benchexec . result as result <EOL> class Tool ( benchexec . tools . template . BaseTool ) : <EOL> """<STR_LIT>""" <EOL> REQUIRED_PATHS = [ <EOL> "<STR_LIT>" <EOL> ] <EOL> def executable ( self ) : <EOL> return util . find_executable ( '<STR_LIT>' ) <EOL> def version ( self , executable ) : <EOL> return self . _version_from_tool ( executable ) <EOL> def name ( self ) : <EOL> return '<STR_LIT>' <EOL> def cmdline ( self , executable , options , tasks , propertyfile , rlimits ) : <EOL> if ( "<STR_LIT>" not in options ) : <EOL> options = options + [ "<STR_LIT>" ] <EOL> self . options = options <EOL> return [ executable ] + options + tasks <EOL> def determine_result ( self , returncode , returnsignal , output , isTimeout ) : <EOL> def sanitizeXML ( s ) : <EOL> return s . replace ( "<STR_LIT>" , "<STR_LIT>" ) . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> if returnsignal == <NUM_LIT:0> and ( ( returncode == <NUM_LIT:0> ) or ( returncode == <NUM_LIT:10> ) ) : <EOL> try : <EOL> tree = ET . fromstringlist ( map ( sanitizeXML , output ) ) <EOL> status = tree . findtext ( '<STR_LIT>' ) <EOL> if status is None : <EOL> def isErrorMessage ( msg ) : <EOL> return msg . get ( '<STR_LIT:type>' , None ) == '<STR_LIT>' <EOL> messages = list ( filter ( isErrorMessage , tree . getiterator ( '<STR_LIT:message>' ) ) ) <EOL> if messages : <EOL> msg = messages [ <NUM_LIT:0> ] . findtext ( '<STR_LIT:text>' ) <EOL> if msg == '<STR_LIT>' : <EOL> status = '<STR_LIT>' <EOL> elif msg : <EOL> status = '<STR_LIT>' . format ( msg ) <EOL> else : <EOL> status = '<STR_LIT>' <EOL> else : <EOL> status = '<STR_LIT>' <EOL> elif status == "<STR_LIT>" : <EOL> assert returncode == <NUM_LIT:10> <EOL> reason = tree . find ( '<STR_LIT>' ) . find ( '<STR_LIT>' ) . findtext ( '<STR_LIT>' ) <EOL> if not reason : <EOL> reason = tree . find ( '<STR_LIT>' ) . find ( '<STR_LIT>' ) . get ( '<STR_LIT>' ) <EOL> if '<STR_LIT>' in reason : <EOL> status = result . RESULT_UNKNOWN <EOL> else : <EOL> status = result . RESULT_FALSE_REACH <EOL> elif status == "<STR_LIT>" : <EOL> assert returncode == <NUM_LIT:0> <EOL> if "<STR_LIT>" in self . options : <EOL> status = result . RESULT_UNKNOWN <EOL> else : <EOL> status = result . RESULT_TRUE_PROP <EOL> except Exception : <EOL> if isTimeout : <EOL> status = '<STR_LIT>' <EOL> elif '<STR_LIT>' in output : <EOL> status = '<STR_LIT>' <EOL> else : <EOL> status = '<STR_LIT>' <EOL> logging . exception ( "<STR_LIT>" , returncode ) <EOL> elif returncode == <NUM_LIT:64> and '<STR_LIT>' in output : <EOL> status = '<STR_LIT>' <EOL> else : <EOL> status = result . RESULT_ERROR <EOL> return status </s>
