def gracefulrestart (tokeniser, default):
	if len(tokeniser.tokens) == 1:
		return default

	state = string(tokeniser)

	if state in ('disable','disabled'):
		return False

	try:
		grace = int(state)
	except __HOLE__:
		raise ValueError('"%s" is an invalid graceful-restart time' % state)

	if grace < 0:
		raise ValueError('graceful-restart can not be negative')
	if grace > Graceful.MAX:
		raise ValueError('graceful-restart must be smaller or equal to %d' % Graceful.MAX)

	return grace
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/configuration/capability.py/gracefulrestart