def nt2over_gn_groupings(nt):
    """Return the number of grouping ``over'' a note.

    For beamings trees this is the number of beams over each note.

    Args:
        nt (NotationTree): A notation tree, either beaming tree or tuplet tree.

    Returns:
        list: A list of length [number_of_leaves], with integers.
    """
    leaves = nt.get_leaf_nodes()
    # find the leaves depths in the tree
    leaves_depths = [nt.get_depth(leaf) for leaf in leaves]
    return [d - 1 for d in leaves_depths]