def is_threshold_graph(G):
 return is_threshold_sequence(list((d for (n, d) in G.degree())))

def is_threshold_graph ( G ) : return is_threshold_sequence ( list ( ( d for ( n , d ) in G . degree ( ) ) ) )
returns true if g is a threshold graph .