<commit_before>from infomap import infomap

myInfomap = infomap.Infomap("--two-level --verbose")

# Add weight as an optional third argument
network = infomap.Network()
network.addLink(0, 1)
network.addLink(0, 2)
network.addLink(0, 3)
network.addLink(1, 0)
network.addLink(1, 2)
network.addLink(2, 1)
network.addLink(2, 0)
network.addLink(3, 0)
network.addLink(3, 4)
network.addLink(3, 5)
network.addLink(4, 3)
network.addLink(4, 5)
network.addLink(5, 4)
network.addLink(5, 3)

myInfomap.run(network)

print("Found %d modules with codelength: %f" % (myInfomap.numTopModules(), myInfomap.codelength()))

print("\n#node module")

print("Tree:")
for it in myInfomap.tree():
	node = it.current()
	if node.isLeaf():
		print("{} {}".format(node.physicalId, it.moduleIndex()))<commit_msg>Start fix python with refactor to internal network config<commit_after>from infomap import infomap

myInfomap = infomap.Infomap("--two-level --verbose")

# Add weight as an optional third argument
network = myInfomap.network()

network.addLink(0, 1)
network.addLink(0, 2)
network.addLink(0, 3)
network.addLink(1, 0)
network.addLink(1, 2)
network.addLink(2, 1)
network.addLink(2, 0)
network.addLink(3, 0)
network.addLink(3, 4)
network.addLink(3, 5)
network.addLink(4, 3)
network.addLink(4, 5)
network.addLink(5, 4)
network.addLink(5, 3)

myInfomap.run()

print("Found {} modules with codelength: {}".format(myInfomap.numTopModules(), myInfomap.codelength()))

print("\n#node module")

print("Tree:")
for it in myInfomap.tree():
	node = it.current()
	if node.isLeaf():
		print("{} {}".format(node.physicalId, it.moduleIndex()))
{'fraction_non_alphanumeric': 0.16811955168119552, 'fraction_numerical': 0.034869240348692404, 'mean_word_length': 5.896995708154506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5429078', 'n_tokens_mistral': 654, 'n_tokens_neox': 621, 'n_words': 139}