<commit_before>import RPi.GPIO as GPIO
import time
import curses

class NiksRobot:
	def __init__(self):
		#setup
		GPIO.setmode(GPIO.BOARD)
		GPIO.setup(7,GPIO.OUT)
		GPIO.setup(11,GPIO.OUT)
		GPIO.setup(13,GPIO.OUT)
		GPIO.setup(15,GPIO.OUT)
		print 'setup complete'
	def forward(self):
		GPIO.output(7,True)
		GPIO.output(11,False)
		GPIO.output(15,True)
		GPIO.output(13,False)
	def backward(self):
		GPIO.output(7,False)
		GPIO.output(11,True)
		GPIO.output(15,False)
		GPIO.output(13,True)
        def left(self):
                GPIO.output(7,False)
                GPIO.output(11,True)
                GPIO.output(15,True)
                GPIO.output(13,False)
        def right(self):
                GPIO.output(7,True)
                GPIO.output(11,False)
                GPIO.output(15,False)
                GPIO.output(13,True)
        def stop(self):
                GPIO.output(7,False)
                GPIO.output(11,False)
                GPIO.output(15,False)
                GPIO.output(13,False)
	def cleanup(self):
		GPIO.cleanup()


nr = NiksRobot()
screen = curses.initscr()
curses.noecho() 
curses.cbreak()
screen.keypad(True)

try:
        while True:   
            char = screen.getch()
            if char == ord('q'):
                break
            elif char == curses.KEY_UP:
		nr.forward()
            elif char == curses.KEY_DOWN:
                nr.backward()
            elif char == curses.KEY_RIGHT:
                nr.right()
            elif char == curses.KEY_LEFT:
                nr.left()
            elif char == 10:
                nr.stop()
             
finally:
    #Close down curses properly, inc turn echo back on!
    curses.nocbreak(); screen.keypad(0); curses.echo()
    curses.endwin()
    nr.cleanup()
    
<commit_msg>added enable pins<commit_after>import RPi.GPIO as GPIO
import time
import curses


#added motor enable to pi
#pin 16 ->enable
#pin 18 ->enable
class NiksRobot:
	def __init__(self):
		#setup
		GPIO.setmode(GPIO.BOARD)
		GPIO.setup(7,GPIO.OUT)
		GPIO.setup(11,GPIO.OUT)
		GPIO.setup(13,GPIO.OUT)
		GPIO.setup(15,GPIO.OUT)
		print 'setup complete'
	def forward(self):
		GPIO.output(7,True)
		GPIO.output(11,False)
		GPIO.output(15,True)
		GPIO.output(13,False)
	def backward(self):
		GPIO.output(7,False)
		GPIO.output(11,True)
		GPIO.output(15,False)
		GPIO.output(13,True)
        def right(self):
                GPIO.output(7,False)
                GPIO.output(11,True)
                GPIO.output(15,True)
                GPIO.output(13,False)
        def left(self):
                GPIO.output(7,True)
                GPIO.output(11,False)
                GPIO.output(15,False)
                GPIO.output(13,True)
        def stop(self):
                GPIO.output(7,False)
                GPIO.output(11,False)
                GPIO.output(15,False)
                GPIO.output(13,False)
	def cleanup(self):
		GPIO.cleanup()


nr = NiksRobot()
screen = curses.initscr()
curses.noecho() 
curses.cbreak()
screen.keypad(True)

try:
        while True:   
            char = screen.getch()
            if char == ord('q'):
                break
            elif char == curses.KEY_UP:
		nr.forward()
            elif char == curses.KEY_DOWN:
                nr.backward()
            elif char == curses.KEY_RIGHT:
                nr.right()
            elif char == curses.KEY_LEFT:
                nr.left()
            elif char == ord('p'):
                nr.stop()
             
finally:
    #Close down curses properly, inc turn echo back on!
    curses.nocbreak(); screen.keypad(0); curses.echo()
    curses.endwin()
    nr.cleanup()
    

{'fraction_non_alphanumeric': 0.12434518886131789, 'fraction_numerical': 0.025365315687896333, 'mean_word_length': 1.8233463035019455, 'pattern_counts': {'":': 0, '<': 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': '2793383', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1173, 'n_words': 223}