code: def _tricode(G, v, u, w):
      """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.
  
      """
      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])
  
file_path: networkx/networkx/algorithms/triads.py
imports: from collections import defaultdict
  from itertools import combinations, permutations
  import networkx
  from networkx.utils import not_implemented_for, py_random_state
label_desc: Use image node_id 1 for calling a global function with example usage: _tricode(G, v, u, w) and returns: sum