code: def watch(path: Union[Path, str], **kwargs):
      
      loop = asyncio.new_event_loop()
      try:
          _awatch = awatch(path, loop=loop, **kwargs)
          while True:
              try:
                  yield loop.run_until_complete(_awatch.__anext__())
              except StopAsyncIteration:
                  break
      except KeyboardInterrupt:
          logger.debug('KeyboardInterrupt, exiting')
      finally:
          loop.close()
docs: Watch a directory and yield a set of changes whenever files change in that directory or its subdirectories.