ó
|£*^c           @   sR   d  Z  d d l Z d j d d d g ƒ Z d d g Z d d	 „ Z e d
 „ Z	 d S(   s   Unary operations on graphsiÿÿÿÿNs   
s%   Aric Hagberg <aric.hagberg@gmail.com>s   Pieter Swart (swart@lanl.gov)s   Dan Schult(dschult@colgate.edu)t
   complementt   reversec            se   | d k r d ˆ  j } n  ˆ  j ƒ  } | | _ | j ˆ  ƒ | j ‡  f d †  ˆ  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.
    s   complement(%s)c         3   sF   |  ]< \ } } ˆ  D]) } | | k r | | k r | | f Vq q d  S(   N(    (   t   .0t   nt   nbrst   n2(   t   G(    sw   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/networkx/algorithms/operators/unary.pys	   <genexpr>*   s   	N(   t   Nonet   namet	   __class__t   add_nodes_fromt   add_edges_fromt   adjacency_iter(   R   R   t   R(    (   R   sw   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/networkx/algorithms/operators/unary.pyR       s    	c         C   s2   |  j  ƒ  s t j d ƒ ‚ n |  j d | ƒ Sd S(   sC  Return 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.t   copyN(   t   is_directedt   nxt   NetworkXErrorR   (   R   R   (    (    sw   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/networkx/algorithms/operators/unary.pyR   1   s    (
   t   __doc__t   networkxR   t   joint
   __author__t   __all__R   R    t   TrueR   (    (    (    sw   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/networkx/algorithms/operators/unary.pyt   <module>   s   	"