<commit_before>import gpio_pins
import time
import random


class trigger_events():

	def __init__(self):

		try:
			import RPi.GPIO as GPIO
			self.gpio_enabled = True
		except (RuntimeError, ImportError, NameError):
			self.gpio_enabled = False

	def toggle_garage_door(self):

		if self.gpio_enabled:
			import RPi.GPIO as GPIO

			GPIO.setmode(GPIO.BCM)
			GPIO.setup(gpio_pins.GARAGE_OPENER, GPIO.OUT, initial=GPIO.HIGH)
			GPIO.output(gpio_pins.GARAGE_OPENER, GPIO.LOW)
			time.sleep(.1)
			GPIO.output(gpio_pins.GARAGE_OPENER, GPIO.HIGH)
			GPIO.cleanup()


class sense_events():

	def __init__(self):

		try:
			import RPi.GPIO as GPIO
			self.gpio_enabled = True
		except (RuntimeError, ImportError, NameError):
			self.gpio_enabled = False

	def sense_garage_open(self):

		#return True if open, False if closed

		if self.gpio_enabled:

			import RPi.GPIO as GPIO

			#if the garage is up the garage up senson will be 0
			garage_up = not bool(GPIO.input(gpio_pins.GARAGE_SENSOR_UP))

			#if the garage is down the garage down senson will be 0
			garage_down = not bool(GPIO.input(gpio_pins.GARAGE_SENSOR_DOWN))

			if garage_up:
				if not garage_down:
					return 'true'
				else:
					return 'unknown'

			if garage_down:
				if not garage_up:
					return 'false'
				else:
					return 'unknown'

		return 'unknown'
<commit_msg>Had to setup the GPIO inputs<commit_after>import gpio_pins
import time
import random


class trigger_events():

	def __init__(self):

		try:
			import RPi.GPIO as GPIO
			self.gpio_enabled = True
		except (RuntimeError, ImportError, NameError):
			self.gpio_enabled = False

	def toggle_garage_door(self):

		if self.gpio_enabled:
			import RPi.GPIO as GPIO

			GPIO.setmode(GPIO.BCM)
			GPIO.setup(gpio_pins.GARAGE_OPENER, GPIO.OUT, initial=GPIO.HIGH)
			GPIO.output(gpio_pins.GARAGE_OPENER, GPIO.LOW)
			time.sleep(.1)
			GPIO.output(gpio_pins.GARAGE_OPENER, GPIO.HIGH)
			GPIO.cleanup()


class sense_events():

	def __init__(self):

		try:
			import RPi.GPIO as GPIO
			self.gpio_enabled = True
		except (RuntimeError, ImportError, NameError):
			self.gpio_enabled = False

	def sense_garage_open(self):

		#return True if open, False if closed

		if self.gpio_enabled:

			import RPi.GPIO as GPIO

			GPIO.setmode(GPIO.BCM)
			GPIO.setup(gpio_pins.GARAGE_SENSOR_UP, GPIO.IN)
			GPIO.setup(gpio_pins.GARAGE_SENSOR_DOWN, GPIO.IN)

			#if the garage is up the garage up senson will be 0
			garage_up = not bool(GPIO.input(gpio_pins.GARAGE_SENSOR_UP))

			#if the garage is down the garage down senson will be 0
			garage_down = not bool(GPIO.input(gpio_pins.GARAGE_SENSOR_DOWN))

			GPIO.cleanup()

			if garage_up:
				if not garage_down:
					return 'true'
				else:
					return 'unknown'

			if garage_down:
				if not garage_up:
					return 'false'
				else:
					return 'unknown'

		return 'unknown'

{'fraction_non_alphanumeric': 0.0873990873990874, 'fraction_numerical': 0.002106002106002106, 'mean_word_length': 3.5454545454545454, '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': '6466262', 'n_tokens_mistral': 1211, 'n_tokens_neox': 995, 'n_words': 261}