def out_condition_edges(graph, branch_node):
    """Follow the condition edges leading out from a branch node, returning a tuple
    (then_edge, else_edge) where each edge is a tuple (node, dest_node, edge_data).
    """
    then_edge = else_edge = None
    for edge in graph.out_edges(branch_node, data=True):
        data = edge[2]
        if data['condition'] == True:
            then_edge = edge
        elif data['condition'] == False:
            else_edge = edge
    assert then_edge and else_edge
    return then_edge, else_edge
