def _find_terminal_nodes(graph):
    """
    Find all termini of a graph and return the node key.
    A termini is defined as a node with degree of 1. Note
    that graph is assumed to be undirected.
    """
    termini = []
    for node in graph.nodes:
        if graph.degree(node) == 1:
            termini.append(node)

    return termini