def _watch_key(self):
		"""
		Internal function, not intended for external calling
		"""
		zkfunc = getattr(zookeeper, 'exists')
		def handler(h, t, state, p, reraise=False):
			if state != zookeeper.CONNECTED_STATE:
				zc.zk.logger.warning(
					"Node watcher event %r with non-connected state, %r",
					t, state)
				return
			try:
				assert h == self.session.handle
				assert state == zookeeper.CONNECTED_STATE
				assert p == self.path
				if self.session.watches not in self.key:
					return
				assert t == self.event_type or \
					t == self.event_type | pettingzoo.testing.TESTING_FLAG
				try:
					v = zkfunc(self.session.handle, self.path, handler)
				except zookeeper.NoNodeException:
					if t & pettingzoo.testing.TESTING_FLAG:
						v = None
						for watch in self.session.watches.watches(self.key):
							watch._notify(v)
					else:
						self._rewatch()
				else:
					for watch in self.session.watches.watches(self.key):
						watch._notify(v)
			except:
				exc_class, exc, tb = sys.exc_info()
				sys.stderr.write(str(exc_class) + "\n")
				traceback.print_tb(tb)
				zc.zk.logger.exception(
					"%s(%s) handler failed", 'exists', self.path)
				if reraise:
					raise exc_class, exc, tb
		handler(
			self.session.handle,
			self.event_type,
			self.session.state,
			self.path,
			True)
dataset/ETHPy150Open Knewton/pettingzoo-python/pettingzoo/deleted.py/Deleted._watch_key/swapped operands of `not in`