
    fi                     8    d Z ddlZdgZej        d             ZdS )z2Helper functions for community-finding algorithms.    Nis_partitionc                      t          |t                    st          |          } fd|D             }t                     t          |          cxk    ot          d |D                       k    nc S )a  Returns *True* if `communities` is a partition of the nodes of `G`.

    A partition of a universe set is a family of pairwise disjoint sets
    whose union is the entire universe set.

    Parameters
    ----------
    G : NetworkX graph.

    communities : list or iterable of sets of nodes
        If not a list, the iterable is converted internally to a list.
        If it is an iterator it is exhausted.

    c                 &    h | ]}|D ]}|v |	S  r   ).0cnGs      /var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/networkx/algorithms/community/community_utils.py	<setcomp>zis_partition.<locals>.<setcomp>   s*    9991Q99!q&&Q&&&&    c              3   4   K   | ]}t          |          V  d S )N)len)r   r   s     r   	<genexpr>zis_partition.<locals>.<genexpr>   s(      &C&C!s1vv&C&C&C&C&C&Cr   )
isinstancelistr   sum)r
   communitiesnodess   `  r   r   r      s    $ k4(( (;''9999999Eq66SZZCCCC3&C&C{&C&C&C#C#CCCCCCr   )__doc__networkxnx__all___dispatchabler   r   r   r   <module>r      sM    8 8    
 D D D D Dr   