@not_implemented_for('directed')
def generalized_degree(G, nodes=None):
 if (nodes in G):
  return next(_triangles_and_degree_iter(G, nodes))[3]
 return {v: gd for (v, d, t, gd) in _triangles_and_degree_iter(G, nodes)}

@ not_implemented_for ( 'directed' ) def generalized_degree ( G , nodes = None ) : if ( nodes in G ) : return next ( _triangles_and_degree_iter ( G , nodes ) ) [ 3 ] return { v : gd for ( v , d , t , gd ) in _triangles_and_degree_iter ( G , nodes ) }
compute the generalized degree for nodes .