A context manager for temporarily reversing a directed graph in place.
This is a no-op for undirected graphs.
G (graph) – A NetworkX graph.