code: def evaluate(condition):
          
          success = False
          if len(condition) > 0:
              try:
                  rule_name, ast_tokens, evaluate_function = Condition.find_rule(condition)
                  if not rule_name == 'undefined':
                      success = evaluate_function(ast_tokens)
              except AttributeError as exception:
                  Logger.get_logger(__name__).error("Attribute error: %s", exception)
          else:
              success = True
          return success
docs: Evaluate simple condition.
  
          >>> Condition.evaluate('  2  ==  2  ')
          True
          >>> Condition.evaluate('  not  2  ==  2  ')
          False
          >>> Condition.evaluate('  not  "abc"  ==  "xyz"  ')
          True
          >>> Condition.evaluate('2 in [2, 4, 6, 8, 10]')
          True
          >>> Condition.evaluate('5 in [2, 4, 6, 8, 10]')
          False
          >>> Condition.evaluate('"apple" in ["apple", "kiwi", "orange"]')
          True
          >>> Condition.evaluate('5 not in [2, 4, 6, 8, 10]')
          True
          >>> Condition.evaluate('"apple" not in ["kiwi", "orange"]')
          True
  
          Args:
              condition (str): Python condition as string.
  
          Returns:
              bool: True when condition evaluates to True.