def prune_deg_one_nodes(sampled_graph):
    """ prune out degree one nodes from graph """
    deg_one_nodes = []
    for v in sampled_graph.nodes():
        if sampled_graph.degree(v) == 1:
            deg_one_nodes.append(v)

    for v in deg_one_nodes:
        sampled_graph.remove_node(v)

    return sampled_graph