
    h                     :    S r SSKrS/r\R                  S 5       rg)z2Helper functions for community-finding algorithms.    Nis_partitionc                    [        U[        5      (       d  [        U5      nU VVs1 s H  o"  H  o3U ;   d  M
  UiM     M     nnn[        U 5      [        U5      s=:H  =(       a    [        S U 5       5      :H  $ s  $ s  snnf )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              3   8   #    U  H  n[        U5      v   M     g 7f)N)len).0cs     _/var/www/html/env/lib/python3.13/site-packages/networkx/algorithms/community/community_utils.py	<genexpr>is_partition.<locals>.<genexpr>   s     &C{!s1vv{s   )
isinstancelistr   sum)Gcommunitiesr   nnodess        r	   r   r      sl    $ k4((;'#91Qq&QQQE9q6SZCC3&C{&C#CCCCC :s
   A<
A<)__doc__networkxnx__all___dispatchabler        r	   <module>r      s/    8 
 D Dr   