def create_empty_copy(G, with_data=True):
 H = G.__class__()
 H.add_nodes_from(G.nodes(data=with_data))
 if with_data:
  H.graph.update(G.graph)
 return H

def create_empty_copy ( G , with_data = True ) : H = G . __class__ ( ) H . add_nodes_from ( G . nodes ( data = with_data ) ) if with_data : H . graph . update ( G . graph ) return H
return a copy of the graph g with all of the edges removed .