def run(self):
self.__logger.debug("<STR_LIT>", self.__task['<STR_LIT>'])<EOL>if self.__cmdOptions.privateOptions['<STR_LIT>']:<EOL><INDENT>numIters = <NUM_LIT:10><EOL><DEDENT>else:<EOL><INDENT>numIters = self.__task['<STR_LIT>']<EOL><DEDENT>if numIters >= <NUM_LIT:0>:<EOL><INDENT>iterTracker = iter(range(numIters))<EOL><DEDENT>else:<EOL><INDENT>iterTracker = iter(itertools.count())<EOL><DEDENT>periodic = PeriodicActivityMgr(<EOL>requestedActivities=self._createPeriodicActivities())<EOL>self.__model.resetSequenceStates()<EOL>self.__taskDriver.setup()<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>next(iterTracker)<EOL><DEDENT>except StopIteration:<EOL><INDENT>break<EOL><DEDENT>try:<EOL><INDENT>inputRecord = next(self.__datasetReader)<EOL><DEDENT>except StopIteration:<EOL><INDENT>break<EOL><DEDENT>result = self.__taskDriver.handleInputRecord(inputRecord=inputRecord)<EOL>if InferenceElement.encodings in result.inferences:<EOL><INDENT>result.inferences.pop(InferenceElement.encodings)<EOL><DEDENT>self.__predictionLogger.writeRecord(result)<EOL>periodic.tick()<EOL><DEDENT>self._getAndEmitExperimentMetrics(final=True)<EOL>self.__taskDriver.finalize()<EOL>self.__model.resetSequenceStates()<EOL>
Runs a single experiment task