'Remove multiple nodes.
Parameters
nodes : iterable container
A container of nodes (list, dict, set, etc.).  If a node
in the container is not in the graph it is silently
ignored.
See Also
remove_node
Examples
>>> G = nx.path_graph(3)  # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> e = list(G.nodes())
>>> e
[0, 1, 2]
>>> G.remove_nodes_from(e)
>>> list(G.nodes())'

def remove_nodes_from(self, nbunch):

    for n in nbunch:
        try:
            succs = self._succ[n]
            del self._node[n]
            for u in succs:
                del self._pred[u][n]
            del self._succ[n]
            for u in self._pred[n]:
                del self._succ[u][n]
            del self._pred[n]
        except KeyError:
            pass
