def random_degree_sequence_graph(sequence, seed=None, tries=10):
 DSRG = DegreeSequenceRandomGraph(sequence, seed=seed)
 for try_n in range(tries):
  try:
   return DSRG.generate()
  except nx.NetworkXUnfeasible:
   pass
 raise nx.NetworkXError(('failed to generate graph in %d tries' % tries))

def random_degree_sequence_graph ( sequence , seed = None , tries = 10 ) : DSRG = DegreeSequenceRandomGraph ( sequence , seed = seed ) for try_n in range ( tries ) : try : return DSRG . generate ( ) except nx . NetworkXUnfeasible : pass raise nx . NetworkXError ( ( 'failed to generate graph in %d tries' % tries ) )
return a simple random graph with the given degree sequence .