<commit_before>#GOPIGO API http://www.dexterindustries.com/GoPiGo/programming/python-programming-for-the-raspberry-pi-gopigo/

#imports
from gopigo import *
import time

__author__ = '<NAME>'

servo(80)

class Pigo:
    sweep = [None] * 160  #the list to hold scanning data
    MIN_DIST = 50  #distance used when plotting a clear direction... longer so we're planning farther ahead
    status = {'isMoving' : False, 'servo': 90, 'leftSpeed' : 175, 'rightSpeed' : 175, "distance" : 100}
    def __init__(self):
        print "NOW RUNNING OBSTACLE AVOIDER"

    def servoSweep(self):
        for angle in range(15, 150, 5):
            servo(angle)
            time.sleep(.10)
            self.sweep['angle'] = us_dist(15)
            print self.sweep[angle]

    def checkDistance(self):
        self.status['distance'] = us_dist(15)
        print "CHECKING DISTANCE..." + "SOMETHING IS " + str(self.status['distance']) + "mm away"

    def findaPath(self):
        for angle in self.sweep:
            counter = 0
            if self.sweep[angle] > MIN_DIST:
                counter += 1
            else:
                counter = 0
            if counter == 20:
                return True
        return False


butler = Pigo()

''' while  True:
    if butler.servoScan():
        butler.safeDrive()
    if butler.findaPath():
        butler.turnTo(butler.findAngle())
    else:
        butler.turnAround()
butler.stop()
'''
butler.servoSweep()
print butler.findaPath()

<commit_msg>BUG FIX<commit_after>#GOPIGO API http://www.dexterindustries.com/GoPiGo/programming/python-programming-for-the-raspberry-pi-gopigo/

#imports
from gopigo import *
import time

__author__ = '<NAME>'

servo(80)

class Pigo:
    sweep = [None] * 160  #the list to hold scanning data
    MIN_DIST = 50  #distance used when plotting a clear direction... longer so we're planning farther ahead
    status = {'isMoving': False, 'servo': 90, 'leftSpeed': 175, 'rightSpeed': 175, "distance": 100}
    def __init__(self):
        print "NOW RUNNING OBSTACLE AVOIDER"

    def servoSweep(self):
        for angle in range(15, 150, 5):
            servo(angle)
            time.sleep(.10)
            self.sweep[angle] = us_dist(15)
            print self.sweep[angle]

    def findPath(self):
        for angle in self.sweep:
            counter = 0
            if self.sweep[angle] > MIN_DIST:
                counter += 1
            else:
                counter = 0
            if counter == 20:
                return True
        return False

    def turnAround(self):
        right_rot()
        self.sleep(.10)

butler = Pigo()

''' while  True:
    if butler.servoScan():
        butler.safeDrive()
    if butler.findPath():
        butler.turnTo(butler.findAngle())
    else:
        butler.turnAround()
butler.stop()
'''
butler.servoSweep()
print butler.findPath()


{'fraction_non_alphanumeric': 0.11812127584998247, 'fraction_numerical': 0.02453557658604977, 'mean_word_length': 2.224858757062147, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '462167', 'n_tokens_mistral': 1019, 'n_tokens_neox': 903, 'n_words': 235}