def _tricode(G, v, u, w):
 combos = ((v, u, 1), (u, v, 2), (v, w, 4), (w, v, 8), (u, w, 16), (w, u, 32))
 return sum((x for (u, v, x) in combos if (v in G[u])))

def _tricode ( G , v , u , w ) : combos = ( ( v , u , 1 ) , ( u , v , 2 ) , ( v , w , 4 ) , ( w , v , 8 ) , ( u , w , 16 ) , ( w , u , 32 ) ) return sum ( ( x for ( u , v , x ) in combos if ( v in G [ u ] ) ) )
returns the integer code of the given triad .