def node_redundancy(G, nodes=None):
 if (nodes is None):
  nodes = G
 if any(((len(G[v]) < 2) for v in nodes)):
  raise NetworkXError('Cannot compute redundancy coefficient for a node that has fewer than two neighbors.')
 return {v: _node_redundancy(G, v) for v in nodes}

def node_redundancy ( G , nodes = None ) : if ( nodes is None ) : nodes = G if any ( ( ( len ( G [ v ] ) < 2 ) for v in nodes ) ) : raise NetworkXError ( 'Cannot compute redundancy coefficient for a node that has fewer than two neighbors.' ) return { v : _node_redundancy ( G , v ) for v in nodes }
computes the node redundancy coefficients for the nodes in the bipartite graph g .