<s> import networkx as nx <EOL> def s_metric ( G , normalized = True ) : <EOL> """<STR_LIT>""" <EOL> if normalized : <EOL> raise nx . NetworkXError ( "<STR_LIT>" ) <EOL> return float ( sum ( [ G . degree ( u ) * G . degree ( v ) for ( u , v ) in G . edges_iter ( ) ] ) ) </s>
