ó žÃÒYc@@ sˆdZddlmZddlmZdjddgƒZdgZd-Zd.Z d(„e eƒDƒZ d)„Z ed*ƒd+„ƒZ d,S(/s*Functions for analyzing triads of a graph.iÿÿÿÿ(tdivision(tnot_implemented_fors s%Alex Levenson (alex@isnontinvain.com)s9Diederik van Liere (diederik.vanliere@rotman.utoronto.ca)ttriadic_censusiiiiiiiii i i i ii iit003t012t102t021Dt021Ut021Ct111Dt111Ut030Tt030Ct201t120Dt120Ut120Ct210t300cC s'i|]\}}t|d|“qS(i(t TRIAD_NAMES(t.0titcode((sp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/triads.pys %s c sh||df||df||df||df||df||dff}t‡fd†|DƒƒS(sñReturns the integer code of the given triad. This is some fancy magic that comes from Batagelj and Mrvar's paper. It treats each edge joining a pair of `v`, `u`, and `w` as a bit in the binary representation of an integer. iiiiii c3 s.|]$\}}}|ˆ|kr|VqdS(N((Rtutvtx(tG(sp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/triads.pys 2s(tsum(RRRtwtcombos((Rsp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/triads.pyt_tricode(s<t undirectedc C sôd„tDƒ}t|ƒ}d„t|ƒDƒ}x|D]…}t|j|ƒt|j|ƒB}xX|D]P}||||krŠqjn|t|j|ƒBt|j|ƒB||h}|||krý|||krý|dc|t|ƒd7Xs cS si|]\}}||“qS(((RRR((sp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/triads.pys [s RiRiiR( Rtlent enumeratetsettpredtsuccRtTRICODE_TO_NAMERtvalues( RtcensustntmRtvnbrsRt neighborsRR((sp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/triads.pyR5s(#  $ 2 ! <#.N(@iiiiiiiiiiiiiiii iiiiii i i ii i iiii iiiiiii i iii i i ii iiiiii ii iiiii ii iii(s003s012s102RRRR R R R R RRRRR(t__doc__t __future__Rtnetworkx.utilsRtjoint __author__t__all__tTRICODESRR"R&RR(((sp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/triads.pyt s