def cc_sequence()

in geneve/events_emitter_eql.py [0:0]


def cc_sequence(node: eql.ast.Sequence, negate: bool, max_branches: int) -> Root:
    if negate:
        raise NotImplementedError(f"Negation of {type(node)} is not supported")
    queries = [cc_subquery_by(query, negate, max_branches) for query in node.queries]
    if node.close:
        queries.append([[(doc, []) for doc in branch] for branch in collect_constraints(node.close, negate, max_branches)])
    if max_branches:
        nr_branches = math.prod(len(branches) for branches in queries)
        if nr_branches > max_branches:
            raise ValueError(f"Root with too many branches (limit: {max_branches})")
    return Root([cc_join_branch(chain(*branches)) for branches in chain(product(*queries))])