<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys

os.chdir(os.path.dirname(__file__))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".")))

from config import configuration
from bottle import Bottle, error, template

application = Bottle()

@Bottle.error(application)
def error(error):
	return '{ "error": "%s" }' % 'An unexpected error has occurred'

@application.get('/')
def show_status():
    return template('index')<commit_msg>Fire the GPIO pin for the door remote<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys

os.chdir(os.path.dirname(__file__))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".")))

import RPi.GPIO as GPIO
import time
from config import configuration
from bottle import Bottle, error, template

application = Bottle()

@Bottle.error(application)
def error(error):
	return '{ "error": "%s" }' % 'An unexpected error has occurred'

@application.get('/')
def show_status():
    return template('index')

@application.post('/<door_idx:int>/door')
def fire_remote(door_idx):
	# TODO Currently we ignore the door index, it's here to support multiple doors in the future
	GPIO.setmode(GPIO.BOARD)
	GPIO.setup(11, GPIO.OUT, initial=GPIO.LOW)

	GPIO.output(11, GPIO.HIGH)
	time.sleep(0.05)
	GPIO.output(11, GPIO.LOW)

	GPIO.cleanup()

	return template('index')
{'fraction_non_alphanumeric': 0.15598290598290598, 'fraction_numerical': 0.009259259259259259, 'mean_word_length': 5.004273504273504, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 4, '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': '6215361', 'n_tokens_mistral': 485, 'n_tokens_neox': 469, 'n_words': 121}