<commit_before>import benchmark.util as Util
import benchmark.tools.template
import benchmark.result as result

class Tool(benchmark.tools.template.BaseTool):
    """
    Wrapper for a PAGAI tool (http://pagai.forge.imag.fr/).
    """

    def getExecutable(self):
        return Util.findExecutable('pagai')

    def getName(self):
        return 'PAGAI'

    def getStatus(self, returncode, returnsignal, output, isTimeout):
        output = '\n'.join(output)
        if returnsignal == 9 or returnsignal == (128+9):
            if isTimeout:
                status = "TIMEOUT"
            else:
                status = "KILLED BY SIGNAL 9"
        elif "RESULT: TRUE" in output:
            status = result.STATUS_TRUE_PROP
        elif returncode != 0:
            status = "ERROR ({0})".format(returncode)
        elif "RESULT: UNKNOWN" in output:
            status = result.STATUS_UNKNOWN
        else:
            status = result.STATUS_UNKNOWN
        return status

<commit_msg>Updated Tool class to match the new syntax.<commit_after>import benchexec.util as util
import benchexec.tools.template
import benchexec.result as result

class Tool(benchexec.tools.template.BaseTool):
    """
    Wrapper for a PAGAI tool (http://pagai.forge.imag.fr/).
    """

    def executable(self):
        return util.find_executable('pagai')

    def name(self):
        return 'PAGAI'

    def determine_result(self, returncode, returnsignal, output, isTimeout):
        output = '\n'.join(output)
        if returnsignal == 9 or returnsignal == (128+9):
            if isTimeout:
                status = "TIMEOUT"
            else:
                status = "KILLED BY SIGNAL 9"
        elif "RESULT: TRUE" in output:
            status = result.RESULT_TRUE_PROP
        elif returncode != 0:
            status = "ERROR ({0})".format(returncode)
        elif "RESULT: UNKNOWN" in output:
            status = result.RESULT_UNKNOWN
        else:
            status = result.RESULT_UNKNOWN
        return status


{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.007960199004975124, 'mean_word_length': 2.1669291338582677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4976744', 'n_tokens_mistral': 594, 'n_tokens_neox': 566, 'n_words': 157}