<commit_before>import dancemat
import sample
from time import sleep

# Create a dancemat
mat = dancemat.DanceMat()

# Relate button names to positions in the scale
position_dict = {dancemat.Button.triangle: 0,
                 dancemat.Button.down: 1,
                 dancemat.Button.square: 2,
                 dancemat.Button.left: 3,
                 }
# dancemat.Button.right: 4,
# dancemat.Button.x: 5,
# dancemat.Button.up: 6,
# dancemat.Button.circle: 7}

tracks = [sample.WHITE_atmos, sample.WHITE_guitar, sample.WHITE_percnsub, sample.WHITE_sitar]


# Function to listen for changes to button state
def listener(status_dict):
    for button in status_dict.keys():
        is_pressed = status_dict[button]
        # Check if button is in the dictionary
        if button in position_dict and is_pressed:
            number = position_dict[button]
            sample.loop_wav_on_new_thread(tracks[number], no_of_times_to_loop=1)


# Attach that listener function to the dancemat
mat.set_button_listener(listener)
sample.play_track("white", 4)

# Keep reading forever
while 1:
    mat.read()
    sleep(0.05)
<commit_msg>keezy works in some way<commit_after>import dancemat
import sample
from time import sleep

# Create a dancemat
mat = dancemat.DanceMat()

# Relate button names to positions in the scale
position_dict = {dancemat.Button.triangle: 0,
                 dancemat.Button.down: 1,
                 dancemat.Button.square: 2,
                 dancemat.Button.left: 3,
                 }
# dancemat.Button.right: 4,
# dancemat.Button.x: 5,
# dancemat.Button.up: 6,
# dancemat.Button.circle: 7}

tracks = [sample.WHITE_atmos, sample.WHITE_guitar, sample.WHITE_percnsub, sample.WHITE_sitar]


# Function to listen for changes to button state
def listener(status_dict):
    for button in status_dict.keys():
        is_pressed = status_dict[button]
        # Check if button is in the dictionary
        if button in position_dict and is_pressed:
            number = position_dict[button]
            sample.loop_wav_on_new_thread(tracks[number], no_of_times_to_loop=1)


# Attach that listener function to the dancemat
mat.set_button_listener(listener)
# sample.play_track("white", 4)

# Keep reading forever
while 1:
    mat.read()
    sleep(0.05)

{'fraction_non_alphanumeric': 0.08781994704324801, 'fraction_numerical': 0.01235657546337158, 'mean_word_length': 3.1218181818181816, 'pattern_counts': {'":': 0, '<': 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': '5726176', 'n_tokens_mistral': 733, 'n_tokens_neox': 708, 'n_words': 190}