<commit_before>__all__ = ["sqlite_dump", "sqlite_merge"]

from random import Random

def random_expectations(depth=0, breadth=3, low=1, high=10, random=Random()):
    """
    Generate depth x breadth array of random numbers where each row sums to
    high, with a minimum of low.
    """
    result = []
    if depth == 0:
        initial = high + 1
        for i in range(breadth - 1):
            n = random.randint(low, initial - (low * (breadth - i)))
            initial -= n
            result.append(n)
        result.append(initial - low)
        random.shuffle(result)
    else:
        result = [random_expectations(depth - 1, breadth, low, high, random) for x in range(breadth)]
    return result

def weighted_random_choice(choices, weights, random=Random()):
    population = [val for val, cnt in zip(choices, weights) for i in range(int(cnt))]
    return random.choice(population)

def shuffled(target, random=Random()):
    """
    Return a shuffled version of the argument
    """
    a = list(target)
    random.shuffle(a)
    return a

def make_pbs_script(kwargs, hours=60, mins=0, ppn=16, script_name=None):
    """
    Generate a PBS run script to be submitted.
    """

    from disclosuregame.Util.sqlite_merge import list_matching<commit_msg>Added logistic rng<commit_after>__all__ = ["sqlite_dump", "sqlite_merge"]

from random import Random

def random_expectations(depth=0, breadth=3, low=1, high=10, random=Random()):
    """
    Generate depth x breadth array of random numbers where each row sums to
    high, with a minimum of low.
    """
    result = []
    if depth == 0:
        initial = high + 1
        for i in range(breadth - 1):
            n = random.randint(low, initial - (low * (breadth - i)))
            initial -= n
            result.append(n)
        result.append(initial - low)
        random.shuffle(result)
    else:
        result = [random_expectations(depth - 1, breadth, low, high, random) for x in range(breadth)]
    return result

def weighted_random_choice(choices, weights, random=Random()):
    population = [val for val, cnt in zip(choices, weights) for i in range(int(cnt))]
    return random.choice(population)

def logistic_random(loc, scale, random=Random()):
    """
    Return a random number from a specified logistic distribution.
    """
    x = random.Random()
    return loc + scale*math.log(x / (1-x))

def shuffled(target, random=Random()):
    """
    Return a shuffled version of the argument
    """
    a = list(target)
    random.shuffle(a)
    return a

def make_pbs_script(kwargs, hours=60, mins=0, ppn=16, script_name=None):
    """
    Generate a PBS run script to be submitted.
    """

    from disclosuregame.Util.sqlite_merge import list_matching
{'fraction_non_alphanumeric': 0.11476608187134503, 'fraction_numerical': 0.010599415204678362, 'mean_word_length': 2.938129496402878, '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': '5605736', 'n_tokens_mistral': 869, 'n_tokens_neox': 831, 'n_words': 262}