code: def watch(self, path, recursive=False):
          
          self._logger.info('Initializing watcher for path "%s"', path)
  
          handler = FileHandler(self)
          self._observer = Observer()
          self._observer.schedule(handler, path, recursive)
  
          self._logger.info('Starting watcher')
          self._observer.start()
          self._watch = True
  
          try:
              self._logger.info('Waiting for file events')
              while self._watch:
                  time.sleep(1)
          except KeyboardInterrupt: # pragma: no cover
              self.stop_watching()
  
          self._observer.join()
docs: Watch for files in a directory and apply normalizations.
  
          Watch for new or changed files in a directory and apply
          normalizations over them.
  
          Args:
              path: Path to the directory.
              recursive: Whether to find files recursively or not.