<commit_before>from __future__ import print_function
from benchpress import util
import numpy as np

def alain(E):
    N = len(E)-2
    A = np.empty(N+2)
    B = np.empty(N+2)
    C = np.empty(N+2)
    D = np.empty(N+2)
    H = np.empty(N+2)

    A[1:N] = E[0:N-1]
    B[1:N] = A[1:N]*2+3
    C[1:N] = B[1:N] + 99

    D[1:N] = A[N:1:-1] + A[1:N]
    E[1:N] = B[1:N] + C[1:N]*D[1:N]
    F = E[1:N]*4+2
    G = E[1:N]*8-3
    H[1:N] = F + G*E[N:1:-1]
    return H

def main():
    B = util.Benchmark()
    N = B.size[0]
    I = B.size[1]

    E = np.ones(N+2)
    B.start()
    for _ in xrange(I):
        H = alain(E)
        B.flush()
    B.stop()
    B.pprint()

if __name__ == "__main__":
    main()<commit_msg>alain-example: updated<commit_after>from __future__ import print_function
from benchpress import util
import numpy as np

def alain(A,E):
    N = len(E)-2

    A[1:N] = E[0:N-1]
    B = A[1:N]*2+3
    C = B + 99

    D = A[N:1:-1] + A[1:N]
    E[1:N] = B+C*D
    F = E[1:N]*4+2
    G = E[1:N]*8-3
    H = F + G*E[N:1:-1]
    return H

def alain_all_labeled(A,E):
    N = len(E)-2

    A[1:N] = E[0:N-1]

    # B = A[1:N]*2+3
    B = A[1:N]*2
    B += 3

    C = B + 99

    D = A[N:1:-1] + A[1:N]

    # E[1:N] = B+C*D
    E[1:N] = B
    E[1:N] += C
    E[1:N] *= D

    # F = E[1:N]*4+2
    F = E[1:N]*4
    F += 2

    # G = E[1:N]*8-3
    G = E[1:N]*8
    G -= 3

    # H = F + G*E[2:N+1]
    H = F + G
    H *= E[2:N+1]
    return H

def main():
    B = util.Benchmark()
    N = B.size[0]
    I = B.size[1]

    A = np.ones(N+2)
    E = np.ones(N+2)
    B.start()
    for _ in xrange(I):
        H = alain_all_labeled(A,E)
        B.flush()
    B.stop()
    B.pprint()

if __name__ == "__main__":
    main()
{'fraction_non_alphanumeric': 0.21971014492753624, 'fraction_numerical': 0.05623188405797101, 'mean_word_length': 1.8481848184818481, 'pattern_counts': {'":': 2, '<': 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': '2541724', 'n_tokens_mistral': 925, 'n_tokens_neox': 901, 'n_words': 181}