<commit_before>============================
Generators - Degree Sequence
============================



>>> from networkx import *
>>> from networkx.generators.degree_seq import *
>>> from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic
>>> is_isomorphic=graph_could_be_isomorphic # use fast but weak isomorphism checker

configuration_model
-------------------

empty graph has empty degree sequence
>>> deg_seq=[]
>>> G=configuration_model(deg_seq)
>>> G.degree()
[]

>>> deg_seq=[5,3,3,3,3,2,2,2,1,1,1]
>>> G=configuration_model(deg_seq,seed=12345678)
>>> sorted(G.degree(),reverse=True)
[5, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1]
>>> sorted(G.degree(range(len(deg_seq))),reverse=True)
[5, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1]

test that fixed seed delivers the same graph

>>> deg_seq=[3,3,3,3,3,3,3,3,3,3,3,3]
>>> G1=configuration_model(deg_seq,seed=1000)
>>> G2=configuration_model(deg_seq,seed=1000)
>>> is_isomorphic(G1,G2)
True
>>> G1=configuration_model(deg_seq,seed=10)
>>> G2=configuration_model(deg_seq,seed=10)
>>> is_isomorphic(G1,G2)<commit_msg>Use is_isomorphic() instead of could_be_isomorphic() in degree sequence generator tests.<commit_after>============================
Generators - Degree Sequence
============================



>>> from networkx import *
>>> from networkx.generators.degree_seq import *
>>> from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic

configuration_model
-------------------

empty graph has empty degree sequence
>>> deg_seq=[]
>>> G=configuration_model(deg_seq)
>>> G.degree()
[]

>>> deg_seq=[5,3,3,3,3,2,2,2,1,1,1]
>>> G=configuration_model(deg_seq,seed=12345678)
>>> sorted(G.degree(),reverse=True)
[5, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1]
>>> sorted(G.degree(range(len(deg_seq))),reverse=True)
[5, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1]

test that fixed seed delivers the same graph

>>> deg_seq=[3,3,3,3,3,3,3,3,3,3,3,3]
>>> G1=configuration_model(deg_seq,seed=1000)
>>> G2=configuration_model(deg_seq,seed=1000)
>>> is_isomorphic(G1,G2)
True
>>> G1=configuration_model(deg_seq,seed=10)
>>> G2=configuration_model(deg_seq,seed=10)
>>> is_isomorphic(G1,G2)
{'fraction_non_alphanumeric': 0.2370023419203747, 'fraction_numerical': 0.06838407494145199, 'mean_word_length': 6.970149253731344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 108, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3940641', 'n_tokens_mistral': 862, 'n_tokens_neox': 781, 'n_words': 147}