def aggregator (tokeniser):
	first = tokeniser.peek()
	eat = True if first == '(' else False

	if eat:
		tokeniser()

	try:
		as_number,address = tokeniser().split(':')
		local_as = ASN.from_string(as_number)
		local_address = RouterID(address)
	except (__HOLE__,IndexError):
		raise ValueError('invalid aggregator')

	if eat:
		if tokeniser() != ')':
			raise ValueError('invalid aggregator')

	# XXX: This could be buggy - check it
	if local_as.asn4():
		return Aggregator4(local_as,local_address)
	return Aggregator(local_as,local_address)
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/configuration/static/parser.py/aggregator