# Path: craft_ai/errors.py
# class CraftAiDecisionError(CraftAiError):
#     """An error occured during the decision phase."""
# 
# class CraftAiNullDecisionError(CraftAiDecisionError):
#     """An error occured during the decision phase."""
# 
# Path: craft_ai/operators.py
# OPERATORS = OPERATORS_V2
# 
# OPERATORS_FUNCTION = OPERATORS_FUNCTION_V2
# 
# Path: craft_ai/types.py
# TYPES = {
#     "continuous": "continuous",
#     "enum": "enum",
#     "boolean": "boolean",
#     "timezone": "timezone",
#     "time_of_day": "time_of_day",
#     "day_of_week": "day_of_week",
#     "day_of_month": "day_of_month",
#     "month_of_year": "month_of_year",
# }
# 
# Path: craft_ai/timezones.py
# def is_timezone(value):
#     # Valid time zone range is -12:00 (-720 min) and +14:00 (+840 min)
#     # cf. https://en.wikipedia.org/wiki/List_of_UTC_time_offsets
#     if isinstance(value, int) and value <= 840 and value >= -720:
#         return True
#     if not isinstance(value, str):
#         return False
#     if value in TIMEZONES:
#         return True
#     result_reg_exp = _TIMEZONE_REGEX.match(value) is not None
#     return result_reg_exp


import math
import numbers
from craft_ai.errors import CraftAiDecisionError, CraftAiNullDecisionError
from craft_ai.operators import OPERATORS, OPERATORS_FUNCTION
from craft_ai.types import TYPES
from craft_ai.timezones import is_timezone
                new_variance = variance
                new_mean = mean
                new_size = size
                continue
            total_size = 1.0 * size + new_size
            if total_size == 0:
                continue
            new_variance = (1.0 / (total_size - 1.0)) * (
                (size - 1.0) * variance
                + (new_size - 1.0) * new_variance
                + (size * new_size / total_size) * (mean - new_mean) ** 2
            )
            new_mean = (1.0 / total_size) * (size * mean + new_size * new_mean)
            new_size = total_size
        return new_mean, new_size, math.sqrt(new_variance)

    @staticmethod
    def _find_matching_child(node, context):
        for child_index, child in enumerate(node["children"]):
            property_name = child["decision_rule"]["property"]
            operand = child["decision_rule"]["operand"]
            operator = child["decision_rule"]["operator"]
            context_value = context.get(property_name)

            if not isinstance(operator, str) or operator not in OPERATORS.values():
                raise CraftAiDecisionError(
                    """Invalid decision tree format, {} is not a valid"""
                    """ decision operator.""".format(operator)
                )


# Path: craft_ai/errors.py
# class CraftAiDecisionError(CraftAiError):
#     """An error occured during the decision phase."""
# 
# class CraftAiNullDecisionError(CraftAiDecisionError):
#     """An error occured during the decision phase."""
# 
# Path: craft_ai/operators.py
# OPERATORS = OPERATORS_V2
# 
# OPERATORS_FUNCTION = OPERATORS_FUNCTION_V2
# 
# Path: craft_ai/types.py
# TYPES = {
#     "continuous": "continuous",
#     "enum": "enum",
#     "boolean": "boolean",
#     "timezone": "timezone",
#     "time_of_day": "time_of_day",
#     "day_of_week": "day_of_week",
#     "day_of_month": "day_of_month",
#     "month_of_year": "month_of_year",
# }
# 
# Path: craft_ai/timezones.py
# def is_timezone(value):
#     # Valid time zone range is -12:00 (-720 min) and +14:00 (+840 min)
#     # cf. https://en.wikipedia.org/wiki/List_of_UTC_time_offsets
#     if isinstance(value, int) and value <= 840 and value >= -720:
#         return True
#     if not isinstance(value, str):
#         return False
#     if value in TIMEZONES:
#         return True
#     result_reg_exp = _TIMEZONE_REGEX.match(value) is not None
#     return result_reg_exp


# Path: craft_ai/interpreter_v2.py
import math
import numbers
from craft_ai.errors import CraftAiDecisionError, CraftAiNullDecisionError
from craft_ai.operators import OPERATORS, OPERATORS_FUNCTION
from craft_ai.types import TYPES
from craft_ai.timezones import is_timezone

                new_variance = variance
                new_mean = mean
                new_size = size
                continue
            total_size = 1.0 * size + new_size
            if total_size == 0:
                continue
            new_variance = (1.0 / (total_size - 1.0)) * (
                (size - 1.0) * variance
                + (new_size - 1.0) * new_variance
                + (size * new_size / total_size) * (mean - new_mean) ** 2
            )
            new_mean = (1.0 / total_size) * (size * mean + new_size * new_mean)
            new_size = total_size
        return new_mean, new_size, math.sqrt(new_variance)

    @staticmethod
    def _find_matching_child(node, context):
        for child_index, child in enumerate(node["children"]):
            property_name = child["decision_rule"]["property"]
            operand = child["decision_rule"]["operand"]
            operator = child["decision_rule"]["operator"]
            context_value = context.get(property_name)

            if not isinstance(operator, str) or operator not in OPERATORS.values():
                raise CraftAiDecisionError(
                    """Invalid decision tree format, {} is not a valid"""
                    """ decision operator.""".format(operator)
                )


            if OPERATORS_FUNCTION[operator](context_value, operand):