phylox.generators.heath.heath.restrict_network_to_leaf_set

phylox.generators.heath.heath.restrict_network_to_leaf_set(network, leaves_to_keep)

Removes all leaves in the network that are not in the leaves_to_keep container. Then cleans up the network, by iteratively removing out-degree 0 nodes that are not in the leaves_to_keep set, and suppressing in-degree 1 out-degree 1 nodes. Modifies the network in place and returns it.