code: def reverse(G, copy=True):
      """Returns the reverse directed graph of G.
  
      Parameters
      ----------
      G : directed graph
          A NetworkX directed graph
      copy : bool
          If True, then a new graph is returned. If False, then the graph is
          reversed in place.
  
      Returns
      -------
      H : directed graph
          The reversed G.
  
      Raises
      ------
      NetworkXError
          If graph is undirected.
  
      Examples
      --------
      >>> G = nx.DiGraph([(1, 2), (1, 3), (2, 3), (3, 4), (3, 5)])
      >>> G_reversed = nx.reverse(G)
      >>> G_reversed.edges()
      OutEdgeView([(2, 1), (3, 1), (3, 2), (4, 3), (5, 3)])
  
      """
      if not G.is_directed():
          raise nx.NetworkXError("Cannot reverse an undirected graph.")
      else:
          return G.reverse(copy=copy)
  
label_desc: Use image node_id 2 for calling a global function with example usage: reverse(G, copy) and returns: G