def Run(options): commands = ReadCommands(options.commands) while True: while True: logger.debug("Requesting task...") task = poligon.get_task(options.algsynonim, options.algpassword) if task: logger.info("Got task for " + task.AlgSynonim + ". Problem: " + task.ProblemSynonim + ", PocketId: " + str(task.PocketId)) results = ProcessTask(task, options, commands) logger.debug("Task is processed. Registering results...") poligon.register_results(options.algsynonim, options.algpassword, task.PocketId, results) logger.info("Task is processed and results have been registered") else: break if options.wait == 0: break else: logger.info("No more tasks. Going to sleep...") time.sleep(options.wait * 60) logger.info("No more tasks. Exiting...")
self.ObjectsWeights = [] def __init__(self): self.Error = False self.ErrorException = '' self.Test = Result.Data() self.Learn = Result.Data() logger = _init_logger() parser = _init_optparser() (options, args) = parser.parse_args() logger.debug(options) # 1. Loading task info from poligon server task = poligon.get_task(options.algSynonim , options.algPassword) if not task: logger.info( "There is no task for {0} {1}".format( options.algSynonim, options.algPassword)) exit() while task: # 2. Loading task data and creating input files indexes = load_task_data(task, options.algPassword , options.data , options.learnIndexes , options.testIndexes , options.algProperties)