<jupyter_start><jupyter_text>Characterization of patches using mixture models and partition matching.<jupyter_code>import networkx
import matplotlib
%matplotlib nbagg
from matplotlib import pyplot
import pickle
with open('../data/runned.pkl', 'rb') as filehandler:
    DAGs = []
    patchiness = pickle.load(filehandler)
    for tree in patchiness:
        old = tree.pop('patchiness')
        new = networkx.DiGraph()
        for node in old.__dict__["node"]:
            new.add_node(node, **old.__dict__["node"][node])
        for succ in old.__dict__["succ"]:
            for pred in old.__dict__["succ"][succ]:
                new.add_edge(succ, pred)
        tree['DAG'] = new
        DAGs.append(tree)
with open('../data/DAGs.pkl', 'wb') as filehandler:
    pickle.dump(DAGs, filehandler)
new.nodes.data()
with open('../data/DAGs.pkl', 'rb') as filehandler:
    DAGs = pickle.load(filehandler)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13548387096774195, 'fraction_numerical': 0.0, 'mean_word_length': 3.3302325581395347, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '129847', 'license': 'Apache-2.0', 'n_tokens_mistral': 311, 'n_tokens_neox': 311, 'n_words': 70, 'path': 'share/jupyter/characterization.ipynb', 'repo_name': 'StatisKit/FDDPLNG18', 'size': '930'}