def label_nodes(tree):
    """
    Label the internal nodes in the tree.
    :param tree: an ETE tree.
    :return: None
    """
    i = len(tree.get_leaves()) + 1
    t = 1
    for node in tree.traverse('preorder'):
        if not node.is_leaf():
            node.name = 'n' + str(i)
            i += 1
        else:
            node.name = 't' + str(t)
            t += 1
