def evaluate(self, segments, custom_variables):
    'A parser which recursively evaluates the custom_variables passed against\n        the expression tree represented by segments, and returns the result.\n\n        Args:\n            segments(dict): The segments representing the expression tree\n            custom_variables(dict): Key/value pair of variables\n\n        Returns:\n            bool(result): True or False\n        '
    (operator, sub_segments) = get_key_value(segments)
    if (operator == OperatorTypes.NOT):
        return (not self.evaluate(sub_segments, custom_variables))
    elif (operator == OperatorTypes.AND):
        return all((self.evaluate(y, custom_variables) for y in sub_segments))
    elif (operator == OperatorTypes.OR):
        return any((self.evaluate(y, custom_variables) for y in sub_segments))
    elif (operator == OperandTypes.CUSTOM_VARIABLE):
        return self.operand_evaluator.evaluate_custom_variable(sub_segments, custom_variables)
    elif (operator == OperandTypes.USER):
        return self.operand_evaluator.evaluate_user(sub_segments, custom_variables)
A parser which recursively evaluates the custom_variables passed against
the expression tree represented by segments, and returns the result.

Args:
    segments(dict): The segments representing the expression tree
    custom_variables(dict): Key/value pair of variables

Returns:
    bool(result): True or False
def evaluate(self, segments, custom_variables):
    'A parser which recursively evaluates the custom_variables passed against\n        the expression tree represented by segments, and returns the result.\n\n        Args:\n            segments(dict): The segments representing the expression tree\n            custom_variables(dict): Key/value pair of variables\n\n        Returns:\n            bool(result): True or False\n        '
    (operator, sub_segments) = get_key_value(segments)
    if (operator == OperatorTypes.NOT):
        return (not self.evaluate(sub_segments, custom_variables))
    elif (operator == OperatorTypes.AND):
        return all((self.evaluate(y, custom_variables) for y in sub_segments))
    elif (operator == OperatorTypes.OR):
        return any((self.evaluate(y, custom_variables) for y in sub_segments))
    elif (operator == OperandTypes.CUSTOM_VARIABLE):
        return self.operand_evaluator.evaluate_custom_variable(sub_segments, custom_variables)
    elif (operator == OperandTypes.USER):
        return self.operand_evaluator.evaluate_user(sub_segments, custom_variables)