def add_candidate(self, candidate, meta_data=None):
		'''
		Adds new candidate to zookeeper and updates.
		Leader queues to reflect new candidate.

		:param candidate: object that represents the candidate in the queue
		:param meta_data: binary data to store on node
		:rtype: True if operation successfully completed. False otherwise
		'''
		#ensure candidate is not already in queue
		if self.has_candidate(candidate):
			get_logger().warning(
				"LeaderQueue.remove_candidate Candidate already in queue.")
			return False
		else:
			#create node in ZK. Node will be deleted when connection is closed
			flags = zookeeper.EPHEMERAL | zookeeper.SEQUENCE
			newpath = self.connection.create(
				self.path + PREFIX + PREFIX,
				meta_data,
				zc.zk.OPEN_ACL_UNSAFE,
				flags)
			counter = pettingzoo.utils.counter_value(newpath)
			get_logger().info("LeaderQueue.add_candidate %s" % (newpath))
			try:
				#create delete watch
				self._create_deletion_handlers(counter)
			except:
				exc_class, exc, tback = sys.exc_info()
				sys.stderr.write(str(exc_class) + "\n")
				traceback.print_tb(tback)
				raise exc_class, exc, tback
			with self.lock:	
				self.counter_by_candidate[candidate] = counter
				self._handle_add(counter, candidate)
			return True
dataset/ETHPy150Open Knewton/pettingzoo-python/pettingzoo/leader_queue.py/LeaderQueue.add_candidate/original