def _to_stublist(degree_sequence):
 return list(chaini((([n] * d) for (n, d) in enumerate(degree_sequence))))

def _to_stublist ( degree_sequence ) : return list ( chaini ( ( ( [ n ] * d ) for ( n , d ) in enumerate ( degree_sequence ) ) ) )
returns a list of degree-repeated node numbers .