def get_all_pathes(tree):
    """Returns all pathes from the root node the each leaf node in the given tree with the associated node probabilities.

    Args:
        tree (Tree): The tree.

    Returns:
        list of lists of tuples: Returns a list of lists of tuples: [ p1, p2, ...] where p1 = [(0, prob), (1, prob), (3, prob)....]
    """
    all_pathes = []
    to_expand = [ (tree.head, []) ]
    while len(to_expand) > 0:
        cur_node, path = to_expand.pop(0)
        
        if cur_node.prediction is not None:
            path.append((cur_node.id, 1))
            all_pathes.append(path)
        else:
            left_path = path.copy()
            left_path.append( (cur_node.id, cur_node.probLeft) )

            right_path = path.copy()
            right_path.append( (cur_node.id, cur_node.probRight) )

            to_expand.append( (cur_node.leftChild, left_path) )
            to_expand.append( (cur_node.rightChild, right_path) )

    return all_pathes