def average_clustering(G, nodes=None, weight=None, count_zeros=True):
 c = clustering(G, nodes, weight=weight).values()
 if (not count_zeros):
  c = [v for v in c if (v > 0)]
 return (sum(c) / len(c))

def average_clustering ( G , nodes = None , weight = None , count_zeros = True ) : c = clustering ( G , nodes , weight = weight ) . values ( ) if ( not count_zeros ) : c = [ v for v in c if ( v > 0 ) ] return ( sum ( c ) / len ( c ) )
estimates the average clustering coefficient of g .