def choose(): inputs = common.get_inputs(["Please enter a number: "], "") option = inputs[0] if option == "1": queries.firstname_lastname_mentors(common.get_cursor()) elif option == "2": queries.nickname_miskolc_mentors(common.get_cursor()) elif option == "3": queries.carol_and_her_hat(common.get_cursor()) elif option == "4": queries.another_girl_hat(common.get_cursor()) elif option == "5": queries.add_new_applicant(common.get_cursor()) elif option == "6": queries.change_phonenumber(common.get_cursor()) elif option == "7": queries.del_arsiano_and_his_friend(common.get_cursor()) elif option == "8": queries.all_data_mentors(common.get_cursor()) elif option == "9": queries.all_data_applicants(common.get_cursor()) elif option == "0": exit() else: raise KeyError("There is no such option.")
def execute(self, possible_venues): print 'execute!' if not self.exists: return 'The net does not exist yet, stop trying to execute it' ann = libfann.neural_net() filename= self.netFileName() ann.create_from_file(filename) processed_venues=[] #for tweaking scaling maxScore = 0 minScore = 100 for v in possible_venues: # log.info(v) score=ann.run(common.get_inputs(v))[0] name= v['name'] vid= v['id'] #also for tweaking scaling if score > maxScore: maxScore= score if score < minScore: minScore=score processed_venues.append([name, score, vid]) print "min, max:" print minScore print maxScore print maxScore - minScore return processed_venues
import common as comm import itertools as itt import sys def solve(input): blue_count = 0 y_length, x_length = comm.get_dimentions(input) for y, x in itt.product(range(y_length - 1), range(x_length - 1)): if input[y][x] == 1 and input[y + 1][x + 1] == 1: blue_count = blue_count + 1 return format_output(blue_count) def format_output(blue_count): output = [] for i in range(5): if i < blue_count: output.append(1) else: output.append(0) return [output] path = sys.argv[1] json_data = comm.load_json(path) inputs = comm.get_inputs(json_data) comm.solve_all(solve, inputs)
def get_inputs(self): inputs = common.get_inputs(self.venueData) return inputs
def get_inputs(self): checkin_inputs = common.get_inputs(self.checkin_venue_data) return(checkin_inputs)