def run(self):
        if self._dir is None:
            # If the directory is None, don't take historic data
            self.dbg("%s is None" % HISTORIC_DIRECTORY)
            return

        self.dbg("Historic thread started")
        while True:
            try:
                now = datetime.datetime.now()
                # Sleep until next hour (61: make sure it's passed)
                next_minute = 61 - now.second
                if self._fake_next_hour:
                    next_hour = next_minute
                else:
                    next_hour = 60 * (59 - now.minute) + next_minute
                self.dbg("Sleeping %s seconds" % next_hour)
                time.sleep(next_hour)
                self.dbg("Awake! taking historic data")
                self._take_historic()
            except Exception as e:
                self.dbg(e % "There was an error: %s")
                traceback.print_exc()


################################################################################
# 
#   
#   
#                         Incubator Experiment
# 
# 
#
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/experiments/incubator.py/StatusManager.run/swapped operands of `%`