prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B. <|fim_middle|> elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
run_forever(-r.S)
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B. <|fim_middle|> else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
stop()
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass <|fim_middle|> elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a <|fim_middle|> elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if f <|fim_middle|> elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
lag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A. <|fim_middle|> elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
stop() flag_A = 0 lock[0] = 30 # lock = 30
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A. <|fim_middle|> elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
run_forever(r.S/slowdown) flag_A = 1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if f <|fim_middle|> if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
lag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A. <|fim_middle|> elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
stop() flag_A = 0 lock[1] = 30 # lock = 30
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A. <|fim_middle|> if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
run_forever(-r.S/slowdown) flag_A = -1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if f <|fim_middle|> elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
lag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C. <|fim_middle|> elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
stop() flag_C = 0 lock[2] = 30 # lock = 30
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C. <|fim_middle|> elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
run_forever(r.S/slowdown) flag_C = 1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if f <|fim_middle|> if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
lag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C. <|fim_middle|> elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
stop flag_C = 0 lock[3] = 30 # lock = 30
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C. <|fim_middle|> if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
run_forever(-r.S/slowdown) flag_C = -1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.st <|fim_middle|> elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
op() flag_A = 0 flag_C = 0
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a <|fim_middle|> else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if f <|fim_middle|> elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
lag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.st <|fim_middle|> elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
op() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.ru <|fim_middle|> elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
n(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if f <|fim_middle|> elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
lag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.st <|fim_middle|> elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
op() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.ru <|fim_middle|> elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
n(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if f <|fim_middle|> elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
lag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.st <|fim_middle|> elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
op() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.ru <|fim_middle|> elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
n(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if f <|fim_middle|> elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
lag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.st <|fim_middle|> elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
op() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.ru <|fim_middle|> elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
n(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.st <|fim_middle|> else: if not flag_A: r.A.stop() if not flag_C: r.C.stop() <|fim▁end|>
op() flag_A = 0 flag_C = 0
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if n <|fim_middle|> <|fim▁end|>
ot flag_A: r.A.stop() if not flag_C: r.C.stop()
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A. <|fim_middle|> if not flag_C: r.C.stop() <|fim▁end|>
stop()
<|file_name|>pilot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from modules import Robot import time r = Robot.Robot() state = [0, 1000, 1500] (run, move, write) = range(3) i = run slowdown = 1 flag_A = 0 flag_C = 0 lock = [0, 0, 0, 0] while(True): a = r.Read() for it in range(len(lock)): if lock[it]: lock[it] = lock[it] - 1 if a[0]: # kontrolka ciągła flag_A = 0 flag_C = 0 if a[0] == 1 or a[0] == 5 or a[0] == 6: r.A.run_forever(r.S/slowdown) elif a[0] == 2 or a[0] == 7 or a[0] == 8: r.A.run_forever(-r.S/slowdown) else: r.A.stop() if a[0] == 3 or a[0] == 5 or a[0] == 7: r.C.run_forever(r.S/slowdown) elif a[0] == 4 or a[0] == 6 or a[0] == 8: r.C.run_forever(-r.S/slowdown) else: r.C.stop() elif a[1] and not lock[1]: # kontrolka lewa: dyskretna if a[1] == 1 and i is not run: # kontrolka prawa: ciągła r.changestate(state[i]-state[i-1]) i = i-1 time.sleep(0.5) # (state[i]-state[i-1])/r.S if i is run: slowdown = 1 elif a[1] == 2 and i is not write: r.changestate(state[i]-state[i+1]) i = i+1 slowdown = 5 time.sleep(0.5) # (state[i+1]-state[i])/r.S elif a[1] == 3: r.B.run_forever(r.S) elif a[1] == 4: r.B.run_forever(-r.S) elif a[1] == 9: r.B.stop() else: pass elif a[2]: # kontrolka one-klick if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon) if flag_A == -1: r.A.stop() flag_A = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.A.run_forever(r.S/slowdown) flag_A = 1 elif a[2] == 2 or a[2] == 7 or a[2] == 8: if flag_A == 1: r.A.stop() flag_A = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.A.run_forever(-r.S/slowdown) flag_A = -1 if a[2] == 3 or a[2] == 5 or a[2] == 7: if flag_C == -1: r.C.stop() flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.C.run_forever(r.S/slowdown) flag_C = 1 elif a[2] == 4 or a[2] == 6 or a[2] == 8: if flag_C == 1: r.C.stop flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.C.run_forever(-r.S/slowdown) flag_C = -1 if a[2] == 9: r.stop() flag_A = 0 flag_C = 0 elif a[3]: # alternatywna one-klick if a[3] == 1: # 1 przycisk - oba silniki if flag_A == -1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[0] = 30 # lock = 30 elif not lock[0]: r.run(r.S/slowdown, r.S/slowdown) flag_A = 1 flag_C = 1 elif a[3] == 2: if flag_A == 1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[1] = 30 # lock = 30 elif not lock[1]: r.run(-r.S/slowdown, -r.S/slowdown) flag_A = -1 flag_C = -1 elif a[3] == 3: if flag_A == 1 and flag_C == -1: r.stop() flag_A = 0 flag_C = 0 lock[2] = 30 # lock = 30 elif not lock[2]: r.run(-r.S/slowdown, r.S/slowdown) flag_A = -1 flag_C = 1 elif a[3] == 4: if flag_A == -1 and flag_C == 1: r.stop() flag_A = 0 flag_C = 0 lock[3] = 30 # lock = 30 elif not lock[3]: r.run(r.S/slowdown, -r.S/slowdown) flag_A = 1 flag_C = -1 elif a[3] == 9: r.stop() flag_A = 0 flag_C = 0 else: if not flag_A: r.A.stop() if not flag_C: r.C. <|fim_middle|> <|fim▁end|>
stop()
<|file_name|>test_no_emulator.py<|end_file_name|><|fim▁begin|>def test_dummy_request():<|fim▁hole|> norm = em.normalise_request_json({"text": ["arb text"]}) assert norm == {"text": "arb text", "time": None} norm = em.normalise_request_json({"text": ["arb text"], "time": "1499279161658"}) assert norm == {"text": "arb text", "time": "1499279161658"} def test_dummy_response(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() data = {"intent": "greet", "text": "hi", "entities": {}, "confidence": 1.0} assert em.normalise_response_json(data) == data def test_emulators_can_handle_missing_data(): from rasa.nlu.emulators.luis import LUISEmulator em = LUISEmulator() norm = em.normalise_response_json( {"text": "this data doesn't contain an intent result"} ) assert norm["prediction"]["topIntent"] is None assert norm["prediction"]["intents"] == {}<|fim▁end|>
from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator()
<|file_name|>test_no_emulator.py<|end_file_name|><|fim▁begin|>def test_dummy_request(): <|fim_middle|> def test_dummy_response(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() data = {"intent": "greet", "text": "hi", "entities": {}, "confidence": 1.0} assert em.normalise_response_json(data) == data def test_emulators_can_handle_missing_data(): from rasa.nlu.emulators.luis import LUISEmulator em = LUISEmulator() norm = em.normalise_response_json( {"text": "this data doesn't contain an intent result"} ) assert norm["prediction"]["topIntent"] is None assert norm["prediction"]["intents"] == {} <|fim▁end|>
from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() norm = em.normalise_request_json({"text": ["arb text"]}) assert norm == {"text": "arb text", "time": None} norm = em.normalise_request_json({"text": ["arb text"], "time": "1499279161658"}) assert norm == {"text": "arb text", "time": "1499279161658"}
<|file_name|>test_no_emulator.py<|end_file_name|><|fim▁begin|>def test_dummy_request(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() norm = em.normalise_request_json({"text": ["arb text"]}) assert norm == {"text": "arb text", "time": None} norm = em.normalise_request_json({"text": ["arb text"], "time": "1499279161658"}) assert norm == {"text": "arb text", "time": "1499279161658"} def test_dummy_response(): <|fim_middle|> def test_emulators_can_handle_missing_data(): from rasa.nlu.emulators.luis import LUISEmulator em = LUISEmulator() norm = em.normalise_response_json( {"text": "this data doesn't contain an intent result"} ) assert norm["prediction"]["topIntent"] is None assert norm["prediction"]["intents"] == {} <|fim▁end|>
from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() data = {"intent": "greet", "text": "hi", "entities": {}, "confidence": 1.0} assert em.normalise_response_json(data) == data
<|file_name|>test_no_emulator.py<|end_file_name|><|fim▁begin|>def test_dummy_request(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() norm = em.normalise_request_json({"text": ["arb text"]}) assert norm == {"text": "arb text", "time": None} norm = em.normalise_request_json({"text": ["arb text"], "time": "1499279161658"}) assert norm == {"text": "arb text", "time": "1499279161658"} def test_dummy_response(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() data = {"intent": "greet", "text": "hi", "entities": {}, "confidence": 1.0} assert em.normalise_response_json(data) == data def test_emulators_can_handle_missing_data(): <|fim_middle|> <|fim▁end|>
from rasa.nlu.emulators.luis import LUISEmulator em = LUISEmulator() norm = em.normalise_response_json( {"text": "this data doesn't contain an intent result"} ) assert norm["prediction"]["topIntent"] is None assert norm["prediction"]["intents"] == {}
<|file_name|>test_no_emulator.py<|end_file_name|><|fim▁begin|>def <|fim_middle|>(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() norm = em.normalise_request_json({"text": ["arb text"]}) assert norm == {"text": "arb text", "time": None} norm = em.normalise_request_json({"text": ["arb text"], "time": "1499279161658"}) assert norm == {"text": "arb text", "time": "1499279161658"} def test_dummy_response(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() data = {"intent": "greet", "text": "hi", "entities": {}, "confidence": 1.0} assert em.normalise_response_json(data) == data def test_emulators_can_handle_missing_data(): from rasa.nlu.emulators.luis import LUISEmulator em = LUISEmulator() norm = em.normalise_response_json( {"text": "this data doesn't contain an intent result"} ) assert norm["prediction"]["topIntent"] is None assert norm["prediction"]["intents"] == {} <|fim▁end|>
test_dummy_request
<|file_name|>test_no_emulator.py<|end_file_name|><|fim▁begin|>def test_dummy_request(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() norm = em.normalise_request_json({"text": ["arb text"]}) assert norm == {"text": "arb text", "time": None} norm = em.normalise_request_json({"text": ["arb text"], "time": "1499279161658"}) assert norm == {"text": "arb text", "time": "1499279161658"} def <|fim_middle|>(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() data = {"intent": "greet", "text": "hi", "entities": {}, "confidence": 1.0} assert em.normalise_response_json(data) == data def test_emulators_can_handle_missing_data(): from rasa.nlu.emulators.luis import LUISEmulator em = LUISEmulator() norm = em.normalise_response_json( {"text": "this data doesn't contain an intent result"} ) assert norm["prediction"]["topIntent"] is None assert norm["prediction"]["intents"] == {} <|fim▁end|>
test_dummy_response
<|file_name|>test_no_emulator.py<|end_file_name|><|fim▁begin|>def test_dummy_request(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() norm = em.normalise_request_json({"text": ["arb text"]}) assert norm == {"text": "arb text", "time": None} norm = em.normalise_request_json({"text": ["arb text"], "time": "1499279161658"}) assert norm == {"text": "arb text", "time": "1499279161658"} def test_dummy_response(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() data = {"intent": "greet", "text": "hi", "entities": {}, "confidence": 1.0} assert em.normalise_response_json(data) == data def <|fim_middle|>(): from rasa.nlu.emulators.luis import LUISEmulator em = LUISEmulator() norm = em.normalise_response_json( {"text": "this data doesn't contain an intent result"} ) assert norm["prediction"]["topIntent"] is None assert norm["prediction"]["intents"] == {} <|fim▁end|>
test_emulators_can_handle_missing_data
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import time import midipy as midi midi.open(128, 0, "midipy test", 0) for (note, t) in [(48,0.5),(48,0.5),(50,1.0),(48,1.0),(53,1.0),(52,1.0),<|fim▁hole|> midi.note_on(note,127) time.sleep(t/2) midi.note_off(note,127) midi.close()<|fim▁end|>
(48,0.5),(48,0.5),(50,1.0),(48,1.0),(55,1.0),(53,1.0)]:
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='fcit', # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html version='1.2.0', description='A decision-tree based conditional independence test', long_description=long_description, # The project's main homepage. url = 'https://github.com/kjchalup/fcit', # Author details author = 'Krzysztof Chalupka', author_email = '[email protected]', # Choose your license license='MIT', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta # 5 - Production/Stable 'Development Status :: 3 - Alpha', # Indicate who your project is intended for 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Artificial Intelligence', # Pick your license as you wish (should match "license" above) 'License :: OSI Approved :: MIT License', # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ], # What does your project relate to? keywords='machine learning statistics decision trees', # You can just specify the packages manually here if your project is # simple. Or you can use find_packages(). packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Alternatively, if you want to distribute just a my_module.py, uncomment # this: # py_modules=["my_module"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['numpy', 'sklearn', 'scipy', 'joblib'],<|fim▁hole|><|fim▁end|>
)
<|file_name|>0009_auto_20191023_0906.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.6 on 2019-10-23 09:06 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import olympia.amo.models<|fim▁hole|> dependencies = [ ('scanners', '0008_auto_20191021_1718'), ] operations = [ migrations.CreateModel( name='ScannerMatch', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False)), ('modified', models.DateTimeField(auto_now=True)), ('result', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scanners.ScannerResult')), ('rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scanners.ScannerRule')), ], options={ 'get_latest_by': 'created', 'abstract': False, 'base_manager_name': 'objects', }, bases=(olympia.amo.models.SearchMixin, olympia.amo.models.SaveUpdateMixin, models.Model), ), migrations.AddField( model_name='scannerresult', name='matched_rules', field=models.ManyToManyField(through='scanners.ScannerMatch', to='scanners.ScannerRule'), ), ]<|fim▁end|>
class Migration(migrations.Migration):
<|file_name|>0009_auto_20191023_0906.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.6 on 2019-10-23 09:06 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import olympia.amo.models class Migration(migrations.Migration): <|fim_middle|> <|fim▁end|>
dependencies = [ ('scanners', '0008_auto_20191021_1718'), ] operations = [ migrations.CreateModel( name='ScannerMatch', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False)), ('modified', models.DateTimeField(auto_now=True)), ('result', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scanners.ScannerResult')), ('rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scanners.ScannerRule')), ], options={ 'get_latest_by': 'created', 'abstract': False, 'base_manager_name': 'objects', }, bases=(olympia.amo.models.SearchMixin, olympia.amo.models.SaveUpdateMixin, models.Model), ), migrations.AddField( model_name='scannerresult', name='matched_rules', field=models.ManyToManyField(through='scanners.ScannerMatch', to='scanners.ScannerRule'), ), ]
<|file_name|>mytaskprolog.py<|end_file_name|><|fim▁begin|># # Copyright 2019-2022 Ghent University # # This file is part of vsc-mympirun, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # the Flemish Research Foundation (FWO) (http://www.fwo.be/en) # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). # # https://github.com/hpcugent/vsc-mympirun #<|fim▁hole|># it under the terms of the GNU General Public License as published by # the Free Software Foundation v2. # # vsc-mympirun is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with vsc-mympirun. If not, see <http://www.gnu.org/licenses/>. # """ End-to-end tests for mypmirun """ import os import logging logging.basicConfig(level=logging.DEBUG) from pmi_utils import PMITest from vsc.utils.affinity import sched_getaffinity, sched_setaffinity class TaskPrologEnd2End(PMITest): def setUp(self): """Prepare to run test.""" super(TaskPrologEnd2End, self).setUp() self.script = os.path.join(os.path.dirname(self.script), 'mytaskprolog.py') def test_simple(self): origaff = sched_getaffinity() aff = sched_getaffinity() aff.set_bits([1]) # only use first core (we can always assume there is one core sched_setaffinity(aff) self.pmirun([], pattern='export CUDA_VISIBLE_DEVICES=0') # restore sched_setaffinity(origaff)<|fim▁end|>
# vsc-mympirun is free software: you can redistribute it and/or modify
<|file_name|>mytaskprolog.py<|end_file_name|><|fim▁begin|># # Copyright 2019-2022 Ghent University # # This file is part of vsc-mympirun, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # the Flemish Research Foundation (FWO) (http://www.fwo.be/en) # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). # # https://github.com/hpcugent/vsc-mympirun # # vsc-mympirun is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation v2. # # vsc-mympirun is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with vsc-mympirun. If not, see <http://www.gnu.org/licenses/>. # """ End-to-end tests for mypmirun """ import os import logging logging.basicConfig(level=logging.DEBUG) from pmi_utils import PMITest from vsc.utils.affinity import sched_getaffinity, sched_setaffinity class TaskPrologEnd2End(PMITest): <|fim_middle|> <|fim▁end|>
def setUp(self): """Prepare to run test.""" super(TaskPrologEnd2End, self).setUp() self.script = os.path.join(os.path.dirname(self.script), 'mytaskprolog.py') def test_simple(self): origaff = sched_getaffinity() aff = sched_getaffinity() aff.set_bits([1]) # only use first core (we can always assume there is one core sched_setaffinity(aff) self.pmirun([], pattern='export CUDA_VISIBLE_DEVICES=0') # restore sched_setaffinity(origaff)
<|file_name|>mytaskprolog.py<|end_file_name|><|fim▁begin|># # Copyright 2019-2022 Ghent University # # This file is part of vsc-mympirun, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # the Flemish Research Foundation (FWO) (http://www.fwo.be/en) # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). # # https://github.com/hpcugent/vsc-mympirun # # vsc-mympirun is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation v2. # # vsc-mympirun is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with vsc-mympirun. If not, see <http://www.gnu.org/licenses/>. # """ End-to-end tests for mypmirun """ import os import logging logging.basicConfig(level=logging.DEBUG) from pmi_utils import PMITest from vsc.utils.affinity import sched_getaffinity, sched_setaffinity class TaskPrologEnd2End(PMITest): def setUp(self): <|fim_middle|> def test_simple(self): origaff = sched_getaffinity() aff = sched_getaffinity() aff.set_bits([1]) # only use first core (we can always assume there is one core sched_setaffinity(aff) self.pmirun([], pattern='export CUDA_VISIBLE_DEVICES=0') # restore sched_setaffinity(origaff) <|fim▁end|>
"""Prepare to run test.""" super(TaskPrologEnd2End, self).setUp() self.script = os.path.join(os.path.dirname(self.script), 'mytaskprolog.py')
<|file_name|>mytaskprolog.py<|end_file_name|><|fim▁begin|># # Copyright 2019-2022 Ghent University # # This file is part of vsc-mympirun, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # the Flemish Research Foundation (FWO) (http://www.fwo.be/en) # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). # # https://github.com/hpcugent/vsc-mympirun # # vsc-mympirun is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation v2. # # vsc-mympirun is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with vsc-mympirun. If not, see <http://www.gnu.org/licenses/>. # """ End-to-end tests for mypmirun """ import os import logging logging.basicConfig(level=logging.DEBUG) from pmi_utils import PMITest from vsc.utils.affinity import sched_getaffinity, sched_setaffinity class TaskPrologEnd2End(PMITest): def setUp(self): """Prepare to run test.""" super(TaskPrologEnd2End, self).setUp() self.script = os.path.join(os.path.dirname(self.script), 'mytaskprolog.py') def test_simple(self): <|fim_middle|> <|fim▁end|>
origaff = sched_getaffinity() aff = sched_getaffinity() aff.set_bits([1]) # only use first core (we can always assume there is one core sched_setaffinity(aff) self.pmirun([], pattern='export CUDA_VISIBLE_DEVICES=0') # restore sched_setaffinity(origaff)
<|file_name|>mytaskprolog.py<|end_file_name|><|fim▁begin|># # Copyright 2019-2022 Ghent University # # This file is part of vsc-mympirun, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # the Flemish Research Foundation (FWO) (http://www.fwo.be/en) # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). # # https://github.com/hpcugent/vsc-mympirun # # vsc-mympirun is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation v2. # # vsc-mympirun is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with vsc-mympirun. If not, see <http://www.gnu.org/licenses/>. # """ End-to-end tests for mypmirun """ import os import logging logging.basicConfig(level=logging.DEBUG) from pmi_utils import PMITest from vsc.utils.affinity import sched_getaffinity, sched_setaffinity class TaskPrologEnd2End(PMITest): def <|fim_middle|>(self): """Prepare to run test.""" super(TaskPrologEnd2End, self).setUp() self.script = os.path.join(os.path.dirname(self.script), 'mytaskprolog.py') def test_simple(self): origaff = sched_getaffinity() aff = sched_getaffinity() aff.set_bits([1]) # only use first core (we can always assume there is one core sched_setaffinity(aff) self.pmirun([], pattern='export CUDA_VISIBLE_DEVICES=0') # restore sched_setaffinity(origaff) <|fim▁end|>
setUp
<|file_name|>mytaskprolog.py<|end_file_name|><|fim▁begin|># # Copyright 2019-2022 Ghent University # # This file is part of vsc-mympirun, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # the Flemish Research Foundation (FWO) (http://www.fwo.be/en) # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). # # https://github.com/hpcugent/vsc-mympirun # # vsc-mympirun is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation v2. # # vsc-mympirun is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with vsc-mympirun. If not, see <http://www.gnu.org/licenses/>. # """ End-to-end tests for mypmirun """ import os import logging logging.basicConfig(level=logging.DEBUG) from pmi_utils import PMITest from vsc.utils.affinity import sched_getaffinity, sched_setaffinity class TaskPrologEnd2End(PMITest): def setUp(self): """Prepare to run test.""" super(TaskPrologEnd2End, self).setUp() self.script = os.path.join(os.path.dirname(self.script), 'mytaskprolog.py') def <|fim_middle|>(self): origaff = sched_getaffinity() aff = sched_getaffinity() aff.set_bits([1]) # only use first core (we can always assume there is one core sched_setaffinity(aff) self.pmirun([], pattern='export CUDA_VISIBLE_DEVICES=0') # restore sched_setaffinity(origaff) <|fim▁end|>
test_simple
<|file_name|>shared_mining_cave_01.py<|end_file_name|><|fim▁begin|>#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/lok/shared_mining_cave_01.iff" result.attribute_template_id = -1 result.stfName("building_name","cave") #### BEGIN MODIFICATIONS ####<|fim▁hole|> return result<|fim▁end|>
#### END MODIFICATIONS ####
<|file_name|>shared_mining_cave_01.py<|end_file_name|><|fim▁begin|>#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): <|fim_middle|> <|fim▁end|>
result = Building() result.template = "object/building/lok/shared_mining_cave_01.iff" result.attribute_template_id = -1 result.stfName("building_name","cave") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
<|file_name|>shared_mining_cave_01.py<|end_file_name|><|fim▁begin|>#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def <|fim_middle|>(kernel): result = Building() result.template = "object/building/lok/shared_mining_cave_01.iff" result.attribute_template_id = -1 result.stfName("building_name","cave") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result<|fim▁end|>
create
<|file_name|>negative_momentum_train_hook.py<|end_file_name|><|fim▁begin|>import torch from hypergan.train_hooks.base_train_hook import BaseTrainHook class NegativeMomentumTrainHook(BaseTrainHook): def __init__(self, gan=None, config=None, trainer=None): super().__init__(config=config, gan=gan, trainer=trainer) self.d_grads = None self.g_grads = None def gradients(self, d_grads, g_grads): if self.d_grads is None: self.d_grads = [torch.zeros_like(_g) for _g in d_grads] self.g_grads = [torch.zeros_like(_g) for _g in g_grads] new_d_grads = [g.clone() for g in d_grads] new_g_grads = [g.clone() for g in g_grads] d_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(d_grads, self.d_grads)] g_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(g_grads, self.g_grads)] self.d_grads = new_d_grads self.g_grads = new_g_grads <|fim▁hole|> return [d_grads, g_grads]<|fim▁end|>
<|file_name|>negative_momentum_train_hook.py<|end_file_name|><|fim▁begin|>import torch from hypergan.train_hooks.base_train_hook import BaseTrainHook class NegativeMomentumTrainHook(BaseTrainHook): <|fim_middle|> <|fim▁end|>
def __init__(self, gan=None, config=None, trainer=None): super().__init__(config=config, gan=gan, trainer=trainer) self.d_grads = None self.g_grads = None def gradients(self, d_grads, g_grads): if self.d_grads is None: self.d_grads = [torch.zeros_like(_g) for _g in d_grads] self.g_grads = [torch.zeros_like(_g) for _g in g_grads] new_d_grads = [g.clone() for g in d_grads] new_g_grads = [g.clone() for g in g_grads] d_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(d_grads, self.d_grads)] g_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(g_grads, self.g_grads)] self.d_grads = new_d_grads self.g_grads = new_g_grads return [d_grads, g_grads]
<|file_name|>negative_momentum_train_hook.py<|end_file_name|><|fim▁begin|>import torch from hypergan.train_hooks.base_train_hook import BaseTrainHook class NegativeMomentumTrainHook(BaseTrainHook): def __init__(self, gan=None, config=None, trainer=None): <|fim_middle|> def gradients(self, d_grads, g_grads): if self.d_grads is None: self.d_grads = [torch.zeros_like(_g) for _g in d_grads] self.g_grads = [torch.zeros_like(_g) for _g in g_grads] new_d_grads = [g.clone() for g in d_grads] new_g_grads = [g.clone() for g in g_grads] d_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(d_grads, self.d_grads)] g_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(g_grads, self.g_grads)] self.d_grads = new_d_grads self.g_grads = new_g_grads return [d_grads, g_grads] <|fim▁end|>
super().__init__(config=config, gan=gan, trainer=trainer) self.d_grads = None self.g_grads = None
<|file_name|>negative_momentum_train_hook.py<|end_file_name|><|fim▁begin|>import torch from hypergan.train_hooks.base_train_hook import BaseTrainHook class NegativeMomentumTrainHook(BaseTrainHook): def __init__(self, gan=None, config=None, trainer=None): super().__init__(config=config, gan=gan, trainer=trainer) self.d_grads = None self.g_grads = None def gradients(self, d_grads, g_grads): <|fim_middle|> <|fim▁end|>
if self.d_grads is None: self.d_grads = [torch.zeros_like(_g) for _g in d_grads] self.g_grads = [torch.zeros_like(_g) for _g in g_grads] new_d_grads = [g.clone() for g in d_grads] new_g_grads = [g.clone() for g in g_grads] d_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(d_grads, self.d_grads)] g_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(g_grads, self.g_grads)] self.d_grads = new_d_grads self.g_grads = new_g_grads return [d_grads, g_grads]
<|file_name|>negative_momentum_train_hook.py<|end_file_name|><|fim▁begin|>import torch from hypergan.train_hooks.base_train_hook import BaseTrainHook class NegativeMomentumTrainHook(BaseTrainHook): def __init__(self, gan=None, config=None, trainer=None): super().__init__(config=config, gan=gan, trainer=trainer) self.d_grads = None self.g_grads = None def gradients(self, d_grads, g_grads): if self.d_grads is None: <|fim_middle|> new_d_grads = [g.clone() for g in d_grads] new_g_grads = [g.clone() for g in g_grads] d_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(d_grads, self.d_grads)] g_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(g_grads, self.g_grads)] self.d_grads = new_d_grads self.g_grads = new_g_grads return [d_grads, g_grads] <|fim▁end|>
self.d_grads = [torch.zeros_like(_g) for _g in d_grads] self.g_grads = [torch.zeros_like(_g) for _g in g_grads]
<|file_name|>negative_momentum_train_hook.py<|end_file_name|><|fim▁begin|>import torch from hypergan.train_hooks.base_train_hook import BaseTrainHook class NegativeMomentumTrainHook(BaseTrainHook): def <|fim_middle|>(self, gan=None, config=None, trainer=None): super().__init__(config=config, gan=gan, trainer=trainer) self.d_grads = None self.g_grads = None def gradients(self, d_grads, g_grads): if self.d_grads is None: self.d_grads = [torch.zeros_like(_g) for _g in d_grads] self.g_grads = [torch.zeros_like(_g) for _g in g_grads] new_d_grads = [g.clone() for g in d_grads] new_g_grads = [g.clone() for g in g_grads] d_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(d_grads, self.d_grads)] g_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(g_grads, self.g_grads)] self.d_grads = new_d_grads self.g_grads = new_g_grads return [d_grads, g_grads] <|fim▁end|>
__init__
<|file_name|>negative_momentum_train_hook.py<|end_file_name|><|fim▁begin|>import torch from hypergan.train_hooks.base_train_hook import BaseTrainHook class NegativeMomentumTrainHook(BaseTrainHook): def __init__(self, gan=None, config=None, trainer=None): super().__init__(config=config, gan=gan, trainer=trainer) self.d_grads = None self.g_grads = None def <|fim_middle|>(self, d_grads, g_grads): if self.d_grads is None: self.d_grads = [torch.zeros_like(_g) for _g in d_grads] self.g_grads = [torch.zeros_like(_g) for _g in g_grads] new_d_grads = [g.clone() for g in d_grads] new_g_grads = [g.clone() for g in g_grads] d_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(d_grads, self.d_grads)] g_grads = [_g - self.config.gamma * _g2 for _g, _g2 in zip(g_grads, self.g_grads)] self.d_grads = new_d_grads self.g_grads = new_g_grads return [d_grads, g_grads] <|fim▁end|>
gradients
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required def centres(request): #Python练习项目管理中心Center return render(request, 'centres/centres.html') def upload(request): #文件上传<|fim▁hole|> return render(request, 'centres/upload.html') def uploadfile(request): import os if request.method == "POST": # 请求方法为POST时,进行处理 myFile =request.FILES.get("myfile", None) # 获取上传的文件,如果没有文件,则默认为None if not myFile: #return HttpResponse("no files for upload!") return render(request, 'centres/upload.html',{'what':'no file for upload!'}) upfile = open(os.path.join("D:\\xHome\\data\\upload",myFile.name),'wb+') # 打开特定的文件进行二进制的写操作 for chunk in myFile.chunks(): # 分块写入文件 upfile.write(chunk) upfile.close() #return HttpResponse("upload over!") return render(request, 'centres/upload.html', {'what':'upload over!'})<|fim▁end|>
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required def centres(request): #Python练习项目管理中心Center return render(re<|fim_middle|> uest): #文件上传 return render(request, 'centres/upload.html') def uploadfile(request): import os if request.method == "POST": # 请求方法为POST时,进行处理 myFile =request.FILES.get("myfile", None) # 获取上传的文件,如果没有文件,则默认为None if not myFile: #return HttpResponse("no files for upload!") return render(request, 'centres/upload.html',{'what':'no file for upload!'}) upfile = open(os.path.join("D:\\xHome\\data\\upload",myFile.name),'wb+') # 打开特定的文件进行二进制的写操作 for chunk in myFile.chunks(): # 分块写入文件 upfile.write(chunk) upfile.close() #return HttpResponse("upload over!") return render(request, 'centres/upload.html', {'what':'upload over!'})<|fim▁end|>
quest, 'centres/centres.html') def upload(req
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required def centres(request): #Python练习项目管理中心Center return render(request, 'centres/centres.html') def upload(request): #文件上传 return render(request, '<|fim_middle|> t): import os if request.method == "POST": # 请求方法为POST时,进行处理 myFile =request.FILES.get("myfile", None) # 获取上传的文件,如果没有文件,则默认为None if not myFile: #return HttpResponse("no files for upload!") return render(request, 'centres/upload.html',{'what':'no file for upload!'}) upfile = open(os.path.join("D:\\xHome\\data\\upload",myFile.name),'wb+') # 打开特定的文件进行二进制的写操作 for chunk in myFile.chunks(): # 分块写入文件 upfile.write(chunk) upfile.close() #return HttpResponse("upload over!") return render(request, 'centres/upload.html', {'what':'upload over!'})<|fim▁end|>
centres/upload.html') def uploadfile(reques
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required def centres(request): #Python练习项目管理中心Center return render(request, 'centres/centres.html') def upload(request): #文件上传 return render(request, 'centres/upload.html') def uploadfile(request): import os if request.me<|fim_middle|> <|fim▁end|>
thod == "POST": # 请求方法为POST时,进行处理 myFile =request.FILES.get("myfile", None) # 获取上传的文件,如果没有文件,则默认为None if not myFile: #return HttpResponse("no files for upload!") return render(request, 'centres/upload.html',{'what':'no file for upload!'}) upfile = open(os.path.join("D:\\xHome\\data\\upload",myFile.name),'wb+') # 打开特定的文件进行二进制的写操作 for chunk in myFile.chunks(): # 分块写入文件 upfile.write(chunk) upfile.close() #return HttpResponse("upload over!") return render(request, 'centres/upload.html', {'what':'upload over!'})
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required def centres(request): #Python练习项目管理中心Center return render(request, 'centres/centres.html') def upload(request): #文件上传 return render(request, 'centres/upload.html') def uploadfile(request): import os if request.method == "POST": # 请求方法为POST时,进行处理 myFile =request.FILES.get("myfile", None) # <|fim_middle|> <|fim▁end|>
获取上传的文件,如果没有文件,则默认为None if not myFile: #return HttpResponse("no files for upload!") return render(request, 'centres/upload.html',{'what':'no file for upload!'}) upfile = open(os.path.join("D:\\xHome\\data\\upload",myFile.name),'wb+') # 打开特定的文件进行二进制的写操作 for chunk in myFile.chunks(): # 分块写入文件 upfile.write(chunk) upfile.close() #return HttpResponse("upload over!") return render(request, 'centres/upload.html', {'what':'upload over!'})
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required def centres(request): #Python练习项目管理中心Center return render(request, 'centres/centres.html') def upload(request): #文件上传 return render(request, 'centres/upload.html') def uploadfile(request): import os if request.method == "POST": # 请求方法为POST时,进行处理 myFile =request.FILES.get("myfile", None) # 获取上传的文件,如果没有文件,则默认为None if not myFile: #return HttpResponse("no files for upload!") return render(request, 'centres/upload.html',{'what':'no file for upload!'}) upfil <|fim_middle|> 定的文件进行二进制的写操作 for chunk in myFile.chunks(): # 分块写入文件 upfile.write(chunk) upfile.close() #return HttpResponse("upload over!") return render(request, 'centres/upload.html', {'what':'upload over!'})<|fim▁end|>
e = open(os.path.join("D:\\xHome\\data\\upload",myFile.name),'wb+') # 打开特
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required def <|fim_middle|>(request): #Python练习项目管理中心Center return render(request, 'centres/centres.html') def upload(request): #文件上传 return render(request, 'centres/upload.html') def uploadfile(request): import os if request.method == "POST": # 请求方法为POST时,进行处理 myFile =request.FILES.get("myfile", None) # 获取上传的文件,如果没有文件,则默认为None if not myFile: #return HttpResponse("no files for upload!") return render(request, 'centres/upload.html',{'what':'no file for upload!'}) upfile = open(os.path.join("D:\\xHome\\data\\upload",myFile.name),'wb+') # 打开特定的文件进行二进制的写操作 for chunk in myFile.chunks(): # 分块写入文件 upfile.write(chunk) upfile.close() #return HttpResponse("upload over!") return render(request, 'centres/upload.html', {'what':'upload over!'})<|fim▁end|>
centres
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required def centres(request): #Python练习项目管理中心Center return render(request, 'centres/centres.html') def upload(request):<|fim_middle|>传 return render(request, 'centres/upload.html') def uploadfile(request): import os if request.method == "POST": # 请求方法为POST时,进行处理 myFile =request.FILES.get("myfile", None) # 获取上传的文件,如果没有文件,则默认为None if not myFile: #return HttpResponse("no files for upload!") return render(request, 'centres/upload.html',{'what':'no file for upload!'}) upfile = open(os.path.join("D:\\xHome\\data\\upload",myFile.name),'wb+') # 打开特定的文件进行二进制的写操作 for chunk in myFile.chunks(): # 分块写入文件 upfile.write(chunk) upfile.close() #return HttpResponse("upload over!") return render(request, 'centres/upload.html', {'what':'upload over!'})<|fim▁end|>
#文件上
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required def centres(request): #Python练习项目管理中心Center return render(request, 'centres/centres.html') def upload(request): #文件上传 return render(request, 'centres/upload.html') def uploadfile(request): <|fim_middle|> if request.method == "POST": # 请求方法为POST时,进行处理 myFile =request.FILES.get("myfile", None) # 获取上传的文件,如果没有文件,则默认为None if not myFile: #return HttpResponse("no files for upload!") return render(request, 'centres/upload.html',{'what':'no file for upload!'}) upfile = open(os.path.join("D:\\xHome\\data\\upload",myFile.name),'wb+') # 打开特定的文件进行二进制的写操作 for chunk in myFile.chunks(): # 分块写入文件 upfile.write(chunk) upfile.close() #return HttpResponse("upload over!") return render(request, 'centres/upload.html', {'what':'upload over!'})<|fim▁end|>
import os
<|file_name|>applicationautoscaling.py<|end_file_name|><|fim▁begin|>"""General-use classes to interact with the ApplicationAutoScaling service through CloudFormation. See Also: `AWS developer guide for ApplicationAutoScaling <https://docs.aws.amazon.com/autoscaling/application/APIReference/Welcome.html>`_ """<|fim▁hole|>from .._raw import applicationautoscaling as _raw # noinspection PyUnresolvedReferences from .._raw.applicationautoscaling import *<|fim▁end|>
# noinspection PyUnresolvedReferences
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import datetime from django.contrib.contenttypes.models import ContentType from django.utils import timezone from .models import Action def create_action(user, verb, target=None): now = timezone.now() last_minute = now - datetime.timedelta(seconds=60) similar_actions = Action.objects.filter(user_id=user.id, verb=verb, created__gte=last_minute) if target: target_ct = ContentType.objects.get_for_model(target) similar_actions = Action.objects.filter(target_ct=target_ct, target_id=target.id) if not similar_actions: action = Action(user=user, verb=verb, target=target) action.save() return True<|fim▁hole|><|fim▁end|>
return False
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import datetime from django.contrib.contenttypes.models import ContentType from django.utils import timezone from .models import Action def create_action(user, verb, target=None): <|fim_middle|> <|fim▁end|>
now = timezone.now() last_minute = now - datetime.timedelta(seconds=60) similar_actions = Action.objects.filter(user_id=user.id, verb=verb, created__gte=last_minute) if target: target_ct = ContentType.objects.get_for_model(target) similar_actions = Action.objects.filter(target_ct=target_ct, target_id=target.id) if not similar_actions: action = Action(user=user, verb=verb, target=target) action.save() return True return False
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import datetime from django.contrib.contenttypes.models import ContentType from django.utils import timezone from .models import Action def create_action(user, verb, target=None): now = timezone.now() last_minute = now - datetime.timedelta(seconds=60) similar_actions = Action.objects.filter(user_id=user.id, verb=verb, created__gte=last_minute) if target: <|fim_middle|> if not similar_actions: action = Action(user=user, verb=verb, target=target) action.save() return True return False <|fim▁end|>
target_ct = ContentType.objects.get_for_model(target) similar_actions = Action.objects.filter(target_ct=target_ct, target_id=target.id)
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import datetime from django.contrib.contenttypes.models import ContentType from django.utils import timezone from .models import Action def create_action(user, verb, target=None): now = timezone.now() last_minute = now - datetime.timedelta(seconds=60) similar_actions = Action.objects.filter(user_id=user.id, verb=verb, created__gte=last_minute) if target: target_ct = ContentType.objects.get_for_model(target) similar_actions = Action.objects.filter(target_ct=target_ct, target_id=target.id) if not similar_actions: <|fim_middle|> return False <|fim▁end|>
action = Action(user=user, verb=verb, target=target) action.save() return True
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import datetime from django.contrib.contenttypes.models import ContentType from django.utils import timezone from .models import Action def <|fim_middle|>(user, verb, target=None): now = timezone.now() last_minute = now - datetime.timedelta(seconds=60) similar_actions = Action.objects.filter(user_id=user.id, verb=verb, created__gte=last_minute) if target: target_ct = ContentType.objects.get_for_model(target) similar_actions = Action.objects.filter(target_ct=target_ct, target_id=target.id) if not similar_actions: action = Action(user=user, verb=verb, target=target) action.save() return True return False <|fim▁end|>
create_action
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base <|fim▁hole|> class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
from general import General from individual import Individual
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): <|fim_middle|> <|fim▁end|>
def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): <|fim_middle|> def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
Base.__init__(self)
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): <|fim_middle|> def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg")
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): <|fim_middle|> def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
self.sonido_boton.reproducir() pilas.almacenar_escena(General())
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): <|fim_middle|> def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
self.sonido_boton.reproducir() pilas.almacenar_escena(Individual())
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): <|fim_middle|> def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
self.sonido_boton.reproducir() pilas.recuperar_escena()
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): <|fim_middle|> def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar()
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): <|fim_middle|> <|fim▁end|>
opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def <|fim_middle|>(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
__init__
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def <|fim_middle|>(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
fondo
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def <|fim_middle|>(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
general
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def <|fim_middle|>(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
individual
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def <|fim_middle|>(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
volver
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def <|fim_middle|>(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def interfaz(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
iniciar
<|file_name|>estadisticas.py<|end_file_name|><|fim▁begin|>import pilas import json from pilas.escena import Base from general import General from individual import Individual class jugadores(Base): def __init__(self): Base.__init__(self) def fondo(self): pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg") def general(self): self.sonido_boton.reproducir() pilas.almacenar_escena(General()) def individual(self): self.sonido_boton.reproducir() pilas.almacenar_escena(Individual()) def volver(self): self.sonido_boton.reproducir() pilas.recuperar_escena() def iniciar(self): self.fondo() self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg") self.interfaz() self.mostrar() def <|fim_middle|>(self): opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)] menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf") menu.escala = 1.3 enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250) enunciado.escala = 0.3<|fim▁end|>
interfaz
<|file_name|>PawnBuildPath.py<|end_file_name|><|fim▁begin|>import json import sublime import sublime_plugin from .edit import Edit class PawnBuildPathCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel( "Working directory that contains pawncc.exe", "C:\\Pawno\\", self.onPawnPathDone, None, None ) def onPawnPathDone(self, path): view = self.view.window().new_file() path = path.replace("\\", "/") obj = { "cmd": [ "pawncc.exe", "$file", "-o$file_path/$file_base_name", "-;+",<|fim▁hole|> ], "file_regex": r"(.*?)\(([0-9]*)[- 0-9]*\)", "selector": "source.pwn", "working_dir": path } with Edit(view) as edit: edit.insert(0, json.dumps(obj, indent=4)) view.set_name("Pawn.sublime-build") view.run_command("save")<|fim▁end|>
"-(+", "-d3"
<|file_name|>PawnBuildPath.py<|end_file_name|><|fim▁begin|>import json import sublime import sublime_plugin from .edit import Edit class PawnBuildPathCommand(sublime_plugin.TextCommand): <|fim_middle|> <|fim▁end|>
def run(self, edit): self.view.window().show_input_panel( "Working directory that contains pawncc.exe", "C:\\Pawno\\", self.onPawnPathDone, None, None ) def onPawnPathDone(self, path): view = self.view.window().new_file() path = path.replace("\\", "/") obj = { "cmd": [ "pawncc.exe", "$file", "-o$file_path/$file_base_name", "-;+", "-(+", "-d3" ], "file_regex": r"(.*?)\(([0-9]*)[- 0-9]*\)", "selector": "source.pwn", "working_dir": path } with Edit(view) as edit: edit.insert(0, json.dumps(obj, indent=4)) view.set_name("Pawn.sublime-build") view.run_command("save")
<|file_name|>PawnBuildPath.py<|end_file_name|><|fim▁begin|>import json import sublime import sublime_plugin from .edit import Edit class PawnBuildPathCommand(sublime_plugin.TextCommand): def run(self, edit): <|fim_middle|> def onPawnPathDone(self, path): view = self.view.window().new_file() path = path.replace("\\", "/") obj = { "cmd": [ "pawncc.exe", "$file", "-o$file_path/$file_base_name", "-;+", "-(+", "-d3" ], "file_regex": r"(.*?)\(([0-9]*)[- 0-9]*\)", "selector": "source.pwn", "working_dir": path } with Edit(view) as edit: edit.insert(0, json.dumps(obj, indent=4)) view.set_name("Pawn.sublime-build") view.run_command("save") <|fim▁end|>
self.view.window().show_input_panel( "Working directory that contains pawncc.exe", "C:\\Pawno\\", self.onPawnPathDone, None, None )
<|file_name|>PawnBuildPath.py<|end_file_name|><|fim▁begin|>import json import sublime import sublime_plugin from .edit import Edit class PawnBuildPathCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel( "Working directory that contains pawncc.exe", "C:\\Pawno\\", self.onPawnPathDone, None, None ) def onPawnPathDone(self, path): <|fim_middle|> <|fim▁end|>
view = self.view.window().new_file() path = path.replace("\\", "/") obj = { "cmd": [ "pawncc.exe", "$file", "-o$file_path/$file_base_name", "-;+", "-(+", "-d3" ], "file_regex": r"(.*?)\(([0-9]*)[- 0-9]*\)", "selector": "source.pwn", "working_dir": path } with Edit(view) as edit: edit.insert(0, json.dumps(obj, indent=4)) view.set_name("Pawn.sublime-build") view.run_command("save")
<|file_name|>PawnBuildPath.py<|end_file_name|><|fim▁begin|>import json import sublime import sublime_plugin from .edit import Edit class PawnBuildPathCommand(sublime_plugin.TextCommand): def <|fim_middle|>(self, edit): self.view.window().show_input_panel( "Working directory that contains pawncc.exe", "C:\\Pawno\\", self.onPawnPathDone, None, None ) def onPawnPathDone(self, path): view = self.view.window().new_file() path = path.replace("\\", "/") obj = { "cmd": [ "pawncc.exe", "$file", "-o$file_path/$file_base_name", "-;+", "-(+", "-d3" ], "file_regex": r"(.*?)\(([0-9]*)[- 0-9]*\)", "selector": "source.pwn", "working_dir": path } with Edit(view) as edit: edit.insert(0, json.dumps(obj, indent=4)) view.set_name("Pawn.sublime-build") view.run_command("save") <|fim▁end|>
run
<|file_name|>PawnBuildPath.py<|end_file_name|><|fim▁begin|>import json import sublime import sublime_plugin from .edit import Edit class PawnBuildPathCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel( "Working directory that contains pawncc.exe", "C:\\Pawno\\", self.onPawnPathDone, None, None ) def <|fim_middle|>(self, path): view = self.view.window().new_file() path = path.replace("\\", "/") obj = { "cmd": [ "pawncc.exe", "$file", "-o$file_path/$file_base_name", "-;+", "-(+", "-d3" ], "file_regex": r"(.*?)\(([0-9]*)[- 0-9]*\)", "selector": "source.pwn", "working_dir": path } with Edit(view) as edit: edit.insert(0, json.dumps(obj, indent=4)) view.set_name("Pawn.sublime-build") view.run_command("save") <|fim▁end|>
onPawnPathDone
<|file_name|>bigFrustrationWorld.py<|end_file_name|><|fim▁begin|><|fim▁hole|>wall((2,0),(2,4)) wall((2,4),(4,4)) wall((2,6),(6,6)) wall((6,6),(6,0)) wall((6,2),(4,2)) initialRobotLoc(1.0, 1.0)<|fim▁end|>
dimensions(8,8)
<|file_name|>get_binary.py<|end_file_name|><|fim▁begin|>""" CMSIS-DAP Interface Firmware Copyright (c) 2009-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 <|fim▁hole|>limitations under the License. Extract and patch the interface without bootloader """ from options import get_options from paths import get_interface_path, TMP_DIR from utils import gen_binary, is_lpc, split_path from os.path import join if __name__ == '__main__': options = get_options() in_path = get_interface_path(options.interface, options.target, bootloader=False) _, name, _ = split_path(in_path) out_path = join(TMP_DIR, name + '.bin') print '\nELF: %s' % in_path gen_binary(in_path, out_path, is_lpc(options.interface)) print "\nBINARY: %s" % out_path<|fim▁end|>
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and