def game_function(): init() currentplayer="O" related_board=[[0 for i in range(15)]for j in range(15)] while gamefinished==False: go(currentplayer,board,related_board) output_board(board) checkwin(currentplayer, board) currentplayer=swap_player(currentplayer)
def go_hpo_predictions(path, fileName): features = (fileName.split(".")[0]).split("_") if features[0].lower() == "tc": taxon = features[3].lower() modelNum = features[2][-1] if taxon == "hpo": return False, "Error in %s\nTerm Centric predictions are for GO terms only and cannot be done for HPO terms." % fileName else: pass else: taxon = features[2].lower() modelNum = features[1][-1] try: modelNum = int(modelNum) except: return False, "Error in %s\nModel number in filename must be integer" % fileName if (modelNum < 1 or modelNum > 3): return False, "Error in %s\nModel number in file name incorrect, you may only submit one to three models\nFormat should be teamId_model#_taxonId/hpo.txt" % fileName if taxon == "hpo": return hpo(path, fileName) else: return go(path, fileName)
def make_listener(self, fn): def new_thread_fn(pipe, fn): from client import Client client = Client(pipe) fn(client) pipe = go(new_thread_fn, from_child=self.pipe.incomming, to_child=Queue.Queue())(fn) return pipe
def connect(host=None, port=6667, nick=None, realname=None, timeout=0.2): pipe = go(create_connection)(host,port,nick,realname,timeout) client = MasterClient(pipe) client.wait_for_connection() return client