def s_metric(G, normalized=True):
 if normalized:
  raise nx.NetworkXError('Normalization not implemented')
 return float(sum([(G.degree(u) * G.degree(v)) for (u, v) in G.edges()]))

def s_metric ( G , normalized = True ) : if normalized : raise nx . NetworkXError ( 'Normalization not implemented' ) return float ( sum ( [ ( G . degree ( u ) * G . degree ( v ) ) for ( u , v ) in G . edges ( ) ] ) )
return the s-metric of graph .