<jupyter_start><jupyter_text>draft<jupyter_code>def merge_two(l1, l2):
    
    out = []
    i = 0
    j = 0
    while i < len(l1) and j < len(l2):
        if l1[i] < l2[j]:
            out.append(l1[i])
            i += 1
        else:
            out.append(l2[j])
            j += 1
    return out + l1[i:] + l2[j:]



def mergesort(l):
    
    half_point = int(len(l) / 2)
    
    if half_point > 0:
        return merge_two(mergesort(l[:half_point]), 
                         mergesort(l[half_point:]))
    else:
        return merge_two(l[:half_point], 
                         l[half_point:])
def selection_sort(l):
    
    n = len(l)
    
    for i in range(n):
        for j in range(i+1, n):
            if l[j] < l[i]:
                num = l[j]
                l[j] = l[i]
                l[i] = num
    return l
tl = [3,0,10,3,5,20,11,100,9,7]
mergesort(tl)
tl
selection_sort(tl)
from pybigo import compare_time
import random
def genfunc(n):
    l = list(range(n))
    random.shuffle(l)
    return l
timecomp = compare_time([mergesort, selection_sort], genfunc, upto_n = 200, runs = 10)
timecomp['median'].plot(figsize=(10,7))
import random
import numpy as np
import json
nb_dic = json.load(open("draft.ipynb"))
np.random.random()
random.sample(range(100),4)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1439509954058193, 'fraction_numerical': 0.033690658499234305, 'mean_word_length': 2.0752941176470587, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 6, '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': '655634', 'license': 'MIT', 'n_tokens_mistral': 532, 'n_tokens_neox': 499, 'n_words': 106, 'path': 'notebooks/draft-1.ipynb', 'repo_name': 'endremborza/pybigo', 'size': '1306'}