def create_file_watcher(pl, watcher_type='auto', expire_time=10):
	if watcher_type == 'stat':
		pl.debug('Using requested stat-based watcher', prefix='watcher')
		return StatFileWatcher()
	if watcher_type == 'inotify':
		# Explicitly selected inotify watcher: do not catch INotifyError then.
		pl.debug('Using requested inotify watcher', prefix='watcher')
		return INotifyFileWatcher(expire_time=expire_time)
	elif watcher_type == 'uv':
		pl.debug('Using requested uv watcher', prefix='watcher')
		return UvFileWatcher()

	if sys.platform.startswith('linux'):
		try:
			pl.debug('Trying to use inotify watcher', prefix='watcher')
			return INotifyFileWatcher(expire_time=expire_time)
		except INotifyError:
			pl.info('Failed to create inotify watcher', prefix='watcher')

	try:
		pl.debug('Using libuv-based watcher')
		return UvFileWatcher()
	except UvNotFound:
		pl.debug('Failed to import pyuv')

	pl.debug('Using stat-based watcher')
	return StatFileWatcher()
Create an object that can watch for changes to specified files
dataset/ETHPy150Open powerline/powerline/powerline/lib/watcher/__init__.py/create_file_watcher