'Returns a copy of the graph with the given list of nodes (and connecting edges).
The layout will be reset.'

def copy(self, nodes=ALL):

    g = Graph(layout=None, distance=self.distance)
    g.layout = self.layout.copy(graph=g)
    for n in (((nodes == ALL) and self.nodes) or (((isinstance(n, Node) and n) or self[n]) for n in nodes)):
        g._add_node_copy(n, root=(self.root == n))
    for e in self.edges:
        g._add_edge_copy(e)
    return g
