<commit_before># Servo Control
import time
import wiringpi
import RPi.GPIO
import random
import time
import requests
import numpy
from twilio.rest import TwilioRestClient
from matrix_keypad import RPi_GPIO
########################################################################3
#Function Junction
def timeout():
    print("TIMED OUT OH NO")
    
    
    
def openDoor():
    wiringpi.pwmWrite(18, 150)  #Open the door
    RPi.GPIO.output(20,True)
    RPi.GPIO.output(17,False)
    print("OPEN DOOR")
    time.sleep(5)
    print("CLOSE DOOR")
    wiringpi.pwmWrite(18, 90)  #Close the door
    RPi.GPIO.output(20,False)
    RPi.GPIO.output(17,True)

    
def badPin():
    print("Phase two bad")
    
    
def badVerify():
    print("VERY BAD")
    
    
def readcode():
    #Reads in numbers until the pound is pressed. Star resets
    attempt = ''
    i = 0
    exit = 0
    brk = 0
    start = time.time()  #Start the timer
    timeout = 30
    while True:  #Loop until pound sign or 60 seconds
        #return '1869'
        key = kp.getKey()
        
        while (key) == None:
            key = kp.getKey()
            end = time.time()  #End the timer
            if(end-start > timeout):  #Timeout if more than a minute elapses
                brk = 1
                break
                
        if(brk == 1):
            break
            
        #key = kp.getKey()
        #Get the key pressed
        print("Key pressed:", key,attempt)
        key = str(key)
        if key == '*':  #Reset
            exit +=1
            if(exit >= 2):
                return 'exit'
            attempt = ''
            start = time.time()
        elif key == '#':  #Return the final number
            print("attempt:",attempt)
            while kp.getKey() != None: #Wait until the key is released
                pass
            return attempt
        else:
            exit = 0
            attempt += key  #Add the key press to the code

        

        while kp.getKey() != None: #Wait until the key is released
            end = time.time()  #End the timer
            if(end-start > timeout):  #Timeout if more than a minute elapses
                brk = 1
                break
        if(brk == 1):
            break
    
    return 'timeout'
##########################################################################################
#Initialize all the things:

# use 'GPIO naming'
wiringpi.wiringPiSetupGpio()
# set #18 to be a PWM output
wiringpi.pinMode(18, wiringpi.GPIO.PWM_OUTPUT)
# set the PWM mode to milliseconds stype
wiringpi.pwmSetMode(wiringpi.GPIO.PWM_MODE_MS)
# divide down clock
wiringpi.pwmSetClock(192)
wiringpi.pwmSetRange(2000)


RPi.GPIO.setmode (RPi.GPIO.BCM)

RPi.GPIO.setup(2, RPi.GPIO.IN, pull_up_down=RPi.GPIO.PUD_UP)
wiringpi.pwmWrite(18, 90)  #Close the door
account_sid = "ACbdbc6719e395ca314cafbb74a38f9441"
auth_token = "<PASSWORD>"
client = TwilioRestClient(account_sid, auth_token)

lst=[]
temp = []
with open('settings.txt') as f:
    a = f.readlines()
    for line in a:
        lst.append(line.strip().split(','))<commit_msg>updated keyPad.py<commit_after># Servo Control
import time
import wiringpi
import RPi.GPIO
import random
import time
import requests
import numpy
from twilio.rest import TwilioRestClient
from matrix_keypad import RPi_GPIO
########################################################################3
#Function Junction
def timeout():
    print("TIMED OUT OH NO")
    
    
    
def openDoor():
    wiringpi.pwmWrite(18, 150)  #Open the door
    RPi.GPIO.output(20,True)
    RPi.GPIO.output(17,False)
    print("OPEN DOOR")
    time.sleep(5)
    print("CLOSE DOOR")
    wiringpi.pwmWrite(18, 90)  #Close the door
    RPi.GPIO.output(20,False)
    RPi.GPIO.output(17,True)

    
def badPin():
    print("Phase two bad")
    
    
def badVerify():
    print("VERY BAD")
    
    
def readcode():
    #Reads in numbers until the pound is pressed. Star resets
    attempt = ''
    i = 0
    exit = 0
    brk = 0
    start = time.time()  #Start the timer
    timeout = 30
    while True:  #Loop until pound sign or 60 seconds
        #return '1869'
        key = kp.getKey()
        
        while (key) == None:
            key = kp.getKey()
            end = time.time()  #End the timer
            if(end-start > timeout):  #Timeout if more than a minute elapses
                brk = 1
                break
                
        if(brk == 1):
            break
            
        #key = kp.getKey()
        #Get the key pressed
        print("Key pressed:", key,attempt)
        key = str(key)
        if key == '*':  #Reset
            exit +=1
            if(exit >= 2):
                return 'exit'
            attempt = ''
            start = time.time()
        elif key == '#':  #Return the final number
            print("attempt:",attempt)
            while kp.getKey() != None: #Wait until the key is released
                pass
            return attempt
        else:
            exit = 0
            attempt += key  #Add the key press to the code

        

        while kp.getKey() != None: #Wait until the key is released
            end = time.time()  #End the timer
            if(end-start > timeout):  #Timeout if more than a minute elapses
                brk = 1
                break
        if(brk == 1):
            break
    
    return 'timeout'
##########################################################################################
#Initialize all the things:

# use 'GPIO naming'
wiringpi.wiringPiSetupGpio()
# set #18 to be a PWM output
wiringpi.pinMode(18, wiringpi.GPIO.PWM_OUTPUT)
# set the PWM mode to milliseconds stype
wiringpi.pwmSetMode(wiringpi.GPIO.PWM_MODE_MS)
# divide down clock
wiringpi.pwmSetClock(192)
wiringpi.pwmSetRange(2000)


RPi.GPIO.setmode (RPi.GPIO.BCM)

RPi.GPIO.setup(2, RPi.GPIO.IN, pull_up_down=RPi.GPIO.PUD_UP)
RPi.GPIO.setup(17, RPi.GPIO.OUT)
RPi.GPIO.setup(20, RPi.GPIO.OUT)
wiringpi.pwmWrite(18, 90)  #Close the door
account_sid = "ACbdbc6719e395ca314cafbb74a38f9441"
auth_token = "<PASSWORD>"
client = TwilioRestClient(account_sid, auth_token)

lst=[]
temp = []
with open('settings.txt') as f:
    a = f.readlines()
    for line in a:
        lst.append(line.strip().split(','))
{'fraction_non_alphanumeric': 0.1527465467394796, 'fraction_numerical': 0.023450048185030516, 'mean_word_length': 2.1851662404092074, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3243026', 'n_tokens_mistral': 2069, 'n_tokens_neox': 1938, 'n_words': 550}