def detect_spam(self):
        """Scan a reply and return a list of potentially spammy attributes
        found in the comment's output.
        """
        output = self.compile_details['output']
        source = self.compile_details['source']
        errors = self.compile_details['stderr']

        spam_behaviors = {
            "Excessive line breaks": output.count('\n') > LINE_LIMIT,
            "Excessive character count": len(output) > CHAR_LIMIT,
            "Spam phrase detected": any([word.encode('utf-8').lower() in
                                         (source + output).encode('utf-8').lower()
                                         for word in SPAM_PHRASES]),
            "Illegal system call detected": "Permission denied" in errors
        }
        if any(spam_behaviors.values()):
            spam_triggers = [k for k, v in spam_behaviors.iteritems() if v]
            return spam_triggers
        return []
dataset/ETHPy150Open renfredxh/compilebot/compilebot/compilebot.py/CompiledReply.detect_spam/original