ó žÃÒYc@sRdZddlZdjdddgƒZddgZdd „Zed „Z dS( sUnary operations on graphsiÿÿÿÿNs s%Aric Hagberg sPieter Swart (swart@lanl.gov)sDan Schult(dschult@colgate.edu)t complementtreversecse|dkrdˆj}nˆjƒ}||_|jˆƒ|j‡fd†ˆjƒDƒƒ|S(sžReturn the graph complement of G. Parameters ---------- G : graph A NetworkX graph name : string Specify name for new graph Returns ------- GC : A new graph. Notes ------ Note that complement() does not create self-loops and also does not produce parallel edges for MultiGraphs. Graph, node, and edge data are not propagated to the new graph. scomplement(%s)c3sF|]<\}}ˆD])}||kr||kr||fVqqdS(N((t.0tntnbrstn2(tG(sy/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/operators/unary.pys *s N(tNonetnamet fresh_copytadd_nodes_fromtadd_edges_fromt adjacency(RRtR((Rsy/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/operators/unary.pyRs    cCs2|jƒstjdƒ‚n|jd|ƒSdS(sCReturn 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. s#Cannot reverse an undirected graph.tcopyN(t is_directedtnxt NetworkXErrorR(RR((sy/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/operators/unary.pyR1s ( t__doc__tnetworkxRtjoint __author__t__all__RRtTrueR(((sy/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/operators/unary.pyts     "