def name_internal_nodes(tree):
    """ Name internal nodes that does not have name

     Parameters
     ----------
     tree : skbio.TreeNode or empress.Tree
         Input tree with labeled tips and partially unlabeled internal nodes or branch lengths.

    Returns
    -------
    skbio.TreeNode or empress.Tree
         Tree with fully labeled internal nodes and branches.
    """
    for i, n in enumerate(tree.postorder(include_self=True)):
        if n.length is None:
            n.length = 1
        if n.name is None:
            new_name = 'y%d' % i
            n.name = new_name
