<commit_before>import serial
import time

ser = serial.Serial('/dev/ttyACM0', 19200, timeout=1)


def lightSwitch(numbers):
    toSend = [0b00000000, ] * 4
    if numbers:
        for light in numbers:
            if light >= 0 and light < 32:
                pos = light % 8
                index = light // 8
                toSend[index] = toSend[index] | (0b10000000 >> pos)
            else:
                toSend = [0b00000000, ] * 4
    else:
        toSend = [0b00000000, ] * 4
    ser.write(toSend)


def lightMusic(ls):
    bass = [7, 16, 18, 23, 26, 27]
    midOne = [5, 12, 22]
    midTwo = [15, 2, 3, 4]
    high = [10, 17, 21, 25, 31]
    discoBall = [29, ]
    return (bass * ls[0] + midOne * ls[1] + midTwo * ls[2] + high * ls[3] + discoBall)

<commit_msg>add new lights<commit_after>import serial
import time

ser = serial.Serial('/dev/ttyACM0', 19200, timeout=1)


def lightSwitch(numbers):
    toSend = [0b00000000, ] * 4
    if numbers:
        for light in numbers:
            if light >= 0 and light < 32:
                pos = light % 8
                index = light // 8
                toSend[index] = toSend[index] | (0b10000000 >> pos)
            else:
                toSend = [0b00000000, ] * 4
    else:
        toSend = [0b00000000, ] * 4
    ser.write(toSend)


def lightMusic(ls):
    bass = [7, 10, 16, 18, 23, 26, 27, 28]
    midOne = [1, 5, 12, 13, 22]
    midTwo = [15, 2, 3, 4]
    high = [14, 17, 21, 25, 31]
    constant = [29]
    return (bass * ls[0] + midOne * ls[1] + midTwo * ls[2] + high * ls[3] + constant)


{'fraction_non_alphanumeric': 0.14184852374839538, 'fraction_numerical': 0.11745827984595636, 'mean_word_length': 1.8658088235294117, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 8, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5164954', 'n_tokens_mistral': 719, 'n_tokens_neox': 556, 'n_words': 166}