o
    ]Zh                     @   s$   d Z ddlZdgZejdd ZdS )z2Helper functions for community-finding algorithms.    Nis_partitionc                    sR   t |ts	t|} fdd|D }t t|  ko&tdd |D kS   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                    s"   h | ]}|D ]}| v r|qqS  r   ).0cnGr   \/var/www/auris/lib/python3.10/site-packages/networkx/algorithms/community/community_utils.py	<setcomp>   s   " zis_partition.<locals>.<setcomp>c                 s   s    | ]}t |V  qd S )N)len)r   r   r   r   r	   	<genexpr>   s    zis_partition.<locals>.<genexpr>)
isinstancelistr   sum)r   Zcommunitiesnodesr   r   r	   r      s   
.)__doc__Znetworkxnx__all__Z_dispatchabler   r   r   r   r	   <module>   s
    