<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def binaryTree_nodeNames(binaryTree):
 """ creates names for the leave and internal nodes of the newick tree from the leaf labels """

    def fn(binaryTree, labels):
        if binaryTree.internal:
            fn(binaryTree.left, labels)
            fn(binaryTree.right, labels)
            labels[binaryTree.traversalID.mid] = labels[binaryTree.left.traversalID.mid] + "_" + labels[binaryTree.right.traversalID.mid]
            return labels[binaryTree.traversalID.mid]
        else:
            labels[binaryTree.traversalID.mid] = str(binaryTree.iD)
            return labels[binaryTree.traversalID.mid]
    labels = [None]*binaryTree.traversalID.midEnd
    fn(binaryTree, labels)
    return labels