Example #1
0
def register_bucket(expression, elements=None, condition_type=ConditionType.BOOLEAN):
    if condition_type == ConditionType.BOOLEAN:
        key = BooleanCondition.build_key(expression)
        if key not in buckets:
            condition = BooleanCondition(expression)
            bucket = Bucket(condition, elements)
            buckets[condition.key] = bucket
Example #2
0
def get_bucket(expression):
    key = BooleanCondition.build_key(expression)
    return buckets.get(key, None)