def get_liberties(state, maximum=8):
	"""A feature encoding the number of liberties of the group connected to the stone at
	each location

	Note:
	- there is no zero-liberties plane; the 0th plane indicates groups in atari
	- the [maximum-1] plane is used for any stone with liberties greater than or equal to maximum
	- EMPTY locations are all-zero features
	"""
	planes = np.zeros((maximum, state.size, state.size))
	for i in range(maximum):
		# single liberties in plane zero (groups won't have zero), double liberties in plane one, etc
		planes[i, state.liberty_counts == i + 1] = 1
	# the "maximum-or-more" case on the backmost plane
	planes[maximum - 1, state.liberty_counts >= maximum] = 1
	return planes
dataset/ETHPy150Open Rochester-NRT/RocAlphaGo/AlphaGo/preprocessing/preprocessing.py/get_liberties/original