<commit_before>import numpy as np
import serial
import time
import pygame
import csv
import os
from multiprocessing import Pool
import random

#Experiment settings
intensity = 1023
color = 'G'
startmin = 1     #[s], Zeit bis zum Start zwischen min/max
startmax = 1.5
time1 = .5       #[s], Zeit ohne Flicker
time2 = 1.7       #[s], Zeit in der der Flicker kommen kann (random)
time3 = .5       #[s], Zeit ohne Flicker
#Ablauf des Experiments: start -> time1 -> time2 (mit flicker) -> time3 -> wait for keyboard input
### LEFT: NEIN, RIGHT: JA

#Daten einlesen
exp_data = np.loadtxt("exp2.txt", delimiter=',')
exp_data = np.tile(exp_data, (10,1))
np.random.shuffle(exp_data)


#Port opening
port = serial.Serial('/dev/ttyACM0')
istring = 'I1\r'
off = 'X\r'
port.write('F10\r')
port.write('H200\r')
port.write('T500\r')
#port.write(off)
cstring = color + str(intensity) + '\r'
port.write('S\r')
#time.sleep(1)
#port.write(off)
port.write(cstring) #Color+Intensity an port
if color == 'G':
    port.write('R0\r')
    port.write('B0\r')
elif color == 'R':
    port.write('B0\r')
    port.write('G0\r')<commit_msg>bugfix<commit_after>import numpy as np
import serial
import time
import pygame
import csv
import os
from multiprocessing import Pool
import random

#Experiment settings
intensity = 1023
color = 'G'
startmin = 1     #[s], Zeit bis zum Start zwischen min/max
startmax = 1.5
time1 = .5       #[s], Zeit ohne Flicker
time2 = 1.7       #[s], Zeit in der der Flicker kommen kann (random)
time3 = .5       #[s], Zeit ohne Flicker
#Ablauf des Experiments: start -> time1 -> time2 (mit flicker) -> time3 -> wait for keyboard input
### LEFT: NEIN, RIGHT: JA

#Daten einlesen
exp_data = np.loadtxt("exp2.txt", delimiter=',')
exp_data = np.tile(exp_data, (10,1))
np.random.shuffle(exp_data)

#Port opening
port = serial.Serial('/dev/ttyACM0')
istring = 'I1\r'
off = 'X\r'
port.write('F10\r')
port.write('H200\r')
port.write('T500\r')
#port.write(off)
cstring = color + str(intensity) + '\r'
port.write('S\r')
#time.sleep(1)
#port.write(off)
port.write(cstring) #Color+Intensity an port
if color == 'G':
    port.write('R0\r')
    port.write('B0\r')
elif color == 'R':
    port.write('B0\r')
    port.write('G0\r')
{'fraction_non_alphanumeric': 0.16199095022624435, 'fraction_numerical': 0.03257918552036199, 'mean_word_length': 3.97972972972973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '7078834', 'n_tokens_mistral': 875, 'n_tokens_neox': 849, 'n_words': 237}