<commit_before>import time
import RPi.GPIO as GPIO

SWITCH_PORT = 23

GPIO.setmode(GPIO.BCM)
GPIO.setup(SWITCH_PORT,  GPIO.IN, pull_up_down=GPIO.PUD_UP)


def my_callback(channel):
    print "falling edge detected on 17"

GPIO.add_event_detect(SWITCH_PORT, GPIO.FALLING,
                      callback=my_callback, bouncetime=300)

try:
    while True:
        time.sleep(0.1)
except KeyboardInterrupt:
    GPIO.cleanup()
GPIO.cleanup()
<commit_msg>le bouton éteind la raspi maintenant<commit_after>import time
import RPi.GPIO as GPIO
import os

SWITCH_PORT = 23

GPIO.setmode(GPIO.BCM)
GPIO.setup(SWITCH_PORT,  GPIO.IN, pull_up_down=GPIO.PUD_UP)


def shutdown_callback(channel):
    print "shutting down"
    os.system('sudo poweroff')

GPIO.add_event_detect(SWITCH_PORT, GPIO.FALLING,
                      callback=my_callback, bouncetime=300)

try:
    while True:
        time.sleep(0.1)
except KeyboardInterrupt:
    GPIO.cleanup()
GPIO.cleanup()

{'fraction_non_alphanumeric': 0.09748427672955975, 'fraction_numerical': 0.016771488469601678, 'mean_word_length': 3.775, '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': '2055874', 'n_tokens_mistral': 364, 'n_tokens_neox': 340, 'n_words': 70}