def isLeaf(tree, nid):
    """
    Test if NodeID is a leaf with no nid attached to it.

    Parameters
    ----------
    tree : treelib.Tree
        Tree where NID is defined.
    nid : treelib.Node
        NodeID to test.

    Returns
    -------
    boolean
        True if node is a leaf, false in other situation
    """
    if len(tree.is_branch(nid)) == 0:
        return True
    else:
        return False