<commit_before>def mult(l,r):
    print "in mult " + str(l) + " " + str(r)
    if l < 10 or r < 10:
        return long(l)*long(r)
    
    # Find middle point
    lSize = len(str(l))
    rSize = len(str(r))
    longest = max(lSize, rSize);
    middle = longest/2
    
    # TODO Check lecture notes for pseudo code
    # split numbers in the middle
    #lHigh = l/10**middle
    #lLow = l%10**middle
    #rHigh = r/10**middle
    #lLow = r%10**middle

    # Do Karatsuba magic
    #z0 = mult(lLow,rLow)
    #z1 = mult((lLow+lHigh), (rLow+rHigh))
    #z2 = mult(lHigh, rHight)
    #return z2*10**(2*middle) + (z1-z2-z0)*10**(middle) + z0

assert(mult(5,0) == 0)
assert(mult(5,5) == 25)
assert(mult(22,33) == 726)
#assert(mult(123456,75643) == 9338582208)<commit_msg>Working, need to clean up tests<commit_after>def mult(l,r):
    if l < 10 or r < 10:
        return l*r
    
    # Find middle point
    lSize = len(str(l))
    rSize = len(str(r))
    longest = max(lSize, rSize);
    middle = longest/2
    
    # split numbers in the middle
    power = 10**middle
    a = l/power
    b = l%power
    c = r/power
    d = r%power

    # Do Karatsuba magic
    ac = mult(a,c)
    bd = mult(b,d)
    ad_plus_bc = mult(a+b, c+d) - ac - bd
    result = ac*10**(2*middle) + ad_plus_bc*10**middle + bd
    return result

def test(l,r):
    print l
    print r
    print mult(l,r)
    print l*r
    print("\n")

#assert(mult(5,0) == 0)
#assert(mult(5,5) == 25)
#assert(mult(12,34) == 408)
#test(2222,3333)
#test(22222,33333)
#test(222222,333333)
#test(2222222,3333333)
first = 3141592653589793238462643383279502884197169399375105820974944592
second = 2718281828459045235360287471352662497757247093699959574966967627

print mult(first, second)
#print first*second
#assert(mult(123456,75643) == 9338582208)
{'fraction_non_alphanumeric': 0.15256124721603564, 'fraction_numerical': 0.155902004454343, 'mean_word_length': 3.1310344827586207, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1683443', 'n_tokens_mistral': 911, 'n_tokens_neox': 741, 'n_words': 161}