def evaluate(self, agentml, user=None):
self._log.debug('<STR_LIT>'<EOL>.format(statement='<STR_LIT:U+0020>'.join(filter(None, [self.type, self.name, self.operator, self.value]))))<EOL>if self.type not in agentml.conditions:<EOL><INDENT>self._log.error('<STR_LIT>'<EOL>.format(type=self.type))<EOL>return<EOL><DEDENT>key_value = agentml.conditions[self.type].get(agentml, user, self.name)<EOL>if self.operator is None and key_value:<EOL><INDENT>return self.contents<EOL><DEDENT>if (self.operator == self.IS) and (key_value == self.value):<EOL><INDENT>return self.contents<EOL><DEDENT>if (self.operator == self.IS_NOT) and (key_value != self.value):<EOL><INDENT>return self.contents<EOL><DEDENT>try:<EOL><INDENT>key_value = float(key_value)<EOL>value = float(self.value)<EOL><DEDENT>except (ValueError, TypeError):<EOL><INDENT>return False<EOL><DEDENT>if (self.operator == self.GREATER_THAN) and (key_value > value):<EOL><INDENT>return self.contents<EOL><DEDENT>if (self.operator == self.GREATER_THAN_OR_EQUAL) and (key_value >= value):<EOL><INDENT>return self.contents<EOL><DEDENT>if (self.operator == self.LESS_THAN) and (key_value < value):<EOL><INDENT>return self.contents<EOL><DEDENT>if (self.operator == self.LESS_THAN_OR_EQUAL) and (key_value <= value):<EOL><INDENT>return self.contents<EOL><DEDENT>return False<EOL>
Evaluate the conditional statement and return its contents if a successful evaluation takes place
:param user: The active user object
:type  user: agentml.User or None

:param agentml: The active AgentML instance
:type  agentml: AgentML

:return: Condition contents if the condition evaluates successfully, otherwise False
:rtype : tuple or bool