# Path: craft_ai/errors.py
# class CraftAiError(Exception):
#     """Base class for exceptions in the craft ai client."""
# 
#     def __init__(self, message=None, metadata=None):
#         self.message = message
#         self.metadata = metadata
#         super(CraftAiError, self).__init__(message, metadata)
# 
#     def __str__(self):
#         return repr(self.message)
# 
# Path: craft_ai/formatters.py
# def format_decision_rules(rules):
#     return " and ".join([_format_decision_rule(rule) for rule in rules])
# 
# Path: craft_ai/operators.py
# OPERATORS = OPERATORS_V2


from functools import reduce as ft_reduce
from .errors import CraftAiError
from .formatters import format_decision_rules
from .operators import OPERATORS



def _is_is_reducer(rule_1, rule_2):
    if rule_1["operand"] and (rule_1["operand"] != rule_2["operand"]):
        raise CraftAiError(
            "Operator '{}' can't have different value. Set to '{}' and receive '{}'".format(

# Path: craft_ai/errors.py
# class CraftAiError(Exception):
#     """Base class for exceptions in the craft ai client."""
# 
#     def __init__(self, message=None, metadata=None):
#         self.message = message
#         self.metadata = metadata
#         super(CraftAiError, self).__init__(message, metadata)
# 
#     def __str__(self):
#         return repr(self.message)
# 
# Path: craft_ai/formatters.py
# def format_decision_rules(rules):
#     return " and ".join([_format_decision_rule(rule) for rule in rules])
# 
# Path: craft_ai/operators.py
# OPERATORS = OPERATORS_V2


# Path: craft_ai/reducer.py
from functools import reduce as ft_reduce
from .errors import CraftAiError
from .formatters import format_decision_rules
from .operators import OPERATORS




def _is_is_reducer(rule_1, rule_2):
    if rule_1["operand"] and (rule_1["operand"] != rule_2["operand"]):
        raise CraftAiError(
            "Operator '{}' can't have different value. Set to '{}' and receive '{}'".format(

                OPERATORS["IS"], rule_1["operand"], rule_2["operand"]