<commit_before>from random import randrange as rr
from random import choice
from string import ascii_uppercase


def random_dag():
    max = 10
    letters = [choice(ascii_uppercase) for _ in range(max)]
    dag = {}
    nums = range(max)
    for k, letter in enumerate(letters):
        dag[k] = {
            'edges': [choice(nums) for _ in range(rr(0, max))],
            'val': choice(letter)
        }
    return dag<commit_msg>Update datamaker helpers<commit_after>from random import randrange as rr
from random import choice
from string import ascii_uppercase


def random_node(vals, nums, max_edges):
    return {
        'edges': [choice(nums) for _ in range(rr(0, max_edges))],
        'val': choice(vals)
    }


def random_graph(max_edges=10):
    letters = [choice(ascii_uppercase) for _ in range(max_edges)]
    dag = {}
    nums = range(max_edges)
    for k, letter in enumerate(letters):
        dag[k] = random_node(letter, nums, max_edges)
    return dag
{'fraction_non_alphanumeric': 0.10596707818930041, 'fraction_numerical': 0.006172839506172839, 'mean_word_length': 3.1939655172413794, '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': '3057942', 'n_tokens_mistral': 325, 'n_tokens_neox': 310, 'n_words': 91}