<jupyter_start><jupyter_text>> **`(!)`** 2021 Written by <NAME> ``  
> This is free and unencumbered software released into the public domain.   ARG Database: [https://mivia.unisa.it/datasets/graph-database/arg-database/documentation/](https://mivia.unisa.it/datasets/graph-database/arg-database/documentation/)<jupyter_code>import struct
import logging

logging.basicConfig(format='[%(asctime)s] %(levelname)s: %(message)s', datefmt='%H:%M:%S')
logging.getLogger().setLevel(level=logging.INFO)

import networkx as nx
from matplotlib import pyplot as plt
plt.rcParams["figure.figsize"] = [21, 9]
with open('graphs/si2_r001_m200.A42', 'rb') as input:
    raw_data = input.read()
cooked_data = [struct.unpack('<h', raw_data[i:i+2])[0] for i in range(0, len(raw_data), 2)]
graph = nx.DiGraph()

num_nodes = cooked_data.pop(0)
logging.info(f"Graph has {num_nodes:,} nodes")

for node in range(num_nodes):
    graph.add_node(node)

for node in range(num_nodes):
    num_edges = cooked_data.pop(0)
    logging.debug(f"Node {node} has {num_edges} edges")
    for edge in range(num_edges):
        target = cooked_data.pop(0)
        label = None    # or label = cooked_data.pop(0)
        graph.add_edge(node, target, label=label)
        logging.debug(f"    {node} =[{label}]=> {target}")
assert not cooked_data
nx.draw(graph, node_size=20)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15467625899280577, 'fraction_numerical': 0.01870503597122302, 'mean_word_length': 4.4980237154150196, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '7523', 'license': 'Unlicense', 'n_tokens_mistral': 524, 'n_tokens_neox': 497, 'n_words': 103, 'path': 'mivia.ipynb', 'repo_name': 'squillero/foie-gras', 'size': '1402'}