def monitor_once(self, execute=True):
        for f in self.files:
            try:
                mtime = os.stat(f).st_mtime
            except __HOLE__:
                #The file might be right in the middle of being written so sleep
                time.sleep(1)
                mtime = os.stat(f).st_mtime

            if f not in self.mtimes.keys():
                self.mtimes[f] = mtime
                continue

            if mtime > self.mtimes[f]:
                if self.verbose: print("File changed: %s" % os.path.realpath(f))
                self.mtimes[f] = mtime
                if execute:
                    self.execute()
                    break
dataset/ETHPy150Open cmheisel/pywatch/src/pywatch/watcher.py/Watcher.monitor_once