def assign_pre_id_to_inner_nodes(phylo_tree):
    """
        Replace the name of the inner nodes of a given phylogenetic tree with
        its preorder number in the tree.
    """
    idx = 0
    for node in phylo_tree.find_clades(terminal=False, order='preorder'):
        node.name = '%d' % (idx)
        idx += 1

    return phylo_tree