<commit_before>#!/usr/bin/python

import RPi.GPIO as GPIO
import time
from HCSR04 import HCSR04
from MotorDriver import MotorDriver
	
if __name__ == "__main__":
    triggerPin = 18
    echoPin = 23
        
    if raw_input("Running pre-flight tests. Proceed? [Y/n] ") == "n" : exit()
    
    hcsr04 = HCSR04(triggerPin, echoPin)
    motorDriver = MotorDriver()

    print "Testing sensor..."
    for i in range(0, 19) :
        print "Range: " + str(hcsr04.getRangeInCentimeters())
        time.sleep(0.5)
        
    if raw_input("Success? [Y/n] ") == "n" : exit() 
    
    print "Testing motor driver..."
    if raw_input("Moving forward...success? [Y/n] ") == "n" : exit()
    motorDriver.forward(0.1)

    if raw_input("Moving backward...success? [Y/n] ") == "n" : exit()
    motorDriver.reverse(0.1)

    if raw_input("Rotating to the right...success? [Y/n] ") == "n" : exit()
    motorDriver.rotateCW(0.1)

    if raw_input("Rotating to the left...success? [Y/n] ") == "n" : exit()
    motorDriver.rotateCCW(0.1)
    
    if raw_input("All tests succeeded. Proceed? [Y/n] ") == "n" : exit()
    
    while 1:
        print "sensing..."
        range = hcsr04.getRangeInCentimeters()
        print "range is " + str(range)

        if range > 50:
            print "moving forward 0.5 secs"
            motorDriver.forward(0.5)
        else:
            print "checking to the right"
            motorDriver.rotateCW(0.2)
        time.sleep(1)<commit_msg>puts test query after test has run<commit_after>#!/usr/bin/python

import RPi.GPIO as GPIO
import time
from HCSR04 import HCSR04
from MotorDriver import MotorDriver
	
if __name__ == "__main__":
    triggerPin = 18
    echoPin = 23
        
    if raw_input("Running pre-flight tests. Proceed? [Y/n] ") == "n" : exit()
    
    hcsr04 = HCSR04(triggerPin, echoPin)
    motorDriver = MotorDriver()

    print "Testing sensor..."
    for i in range(0, 19) :
        print "Range: " + str(hcsr04.getRangeInCentimeters())
        time.sleep(0.5)
        
    if raw_input("Success? [Y/n] ") == "n" : exit() 
    
    print "Testing motor driver..."

    motorDriver.forward(0.1)
    if raw_input("Moving forward...success? [Y/n] ") == "n" : exit()

    motorDriver.reverse(0.1)
    if raw_input("Moving backward...success? [Y/n] ") == "n" : exit()

    motorDriver.rotateCW(0.1)
    if raw_input("Rotating to the right...success? [Y/n] ") == "n" : exit()

    motorDriver.rotateCCW(0.1)
    if raw_input("Rotating to the left...success? [Y/n] ") == "n" : exit()
    
    if raw_input("All tests succeeded. Proceed? [Y/n] ") == "n" : exit()
    
    while 1:
        print "sensing..."
        range = hcsr04.getRangeInCentimeters()
        print "range is " + str(range)

        if range > 50:
            print "moving forward 0.5 secs"
            motorDriver.forward(0.5)
        else:
            print "checking to the right"
            motorDriver.rotateCW(0.2)
        time.sleep(1)
{'fraction_non_alphanumeric': 0.14915254237288136, 'fraction_numerical': 0.026440677966101694, 'mean_word_length': 2.30089485458613, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '1943720', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1002, 'n_words': 251}