def port (tokeniser):
	if not tokeniser.tokens:
		raise ValueError('a port number is required')

	value = tokeniser()
	try:
		return int(value)
	except __HOLE__:
		raise ValueError('"%s" is an invalid port' % value)
	if value < 0:
		raise ValueError('the port must positive')
	if value >= pow(2,16):
		raise ValueError('the port must be smaller than %d' % pow(2,16))
	return value
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/configuration/parser.py/port