def _community (value):
	separator = value.find(':')
	if separator > 0:
		prefix = value[:separator]
		suffix = value[separator+1:]

		if not prefix.isdigit() or not suffix.isdigit():
			raise ValueError('invalid community %s' % value)

		prefix, suffix = int(prefix), int(suffix)

		if prefix > Community.MAX:
			raise ValueError('invalid community %s (prefix too large)' % value)

		if suffix > Community.MAX:
			raise ValueError('invalid community %s (suffix too large)' % value)

		return Community(pack('!L',(prefix << 16) + suffix))

	elif value[:2].lower() == '0x':
		number = long(value,16)
		if number > Community.MAX:
			raise ValueError(value % 'invalid community %s (too large)')
		return Community(pack('!L',number))

	else:
		low = value.lower()
		if low == 'no-export':
			return Community(Community.NO_EXPORT)
		elif low == 'no-advertise':
			return Community(Community.NO_ADVERTISE)
		elif low == 'no-export-subconfed':
			return Community(Community.NO_EXPORT_SUBCONFED)
		# no-peer is not a correct syntax but I am sure someone will make the mistake :)
		elif low == 'nopeer' or low == 'no-peer':
			return Community(Community.NO_PEER)
		elif value.isdigit():
			number = int(value)
			if number > Community.MAX:
				raise ValueError('invalid community %s (too large)' % value)
			return Community(pack('!L',number))
		else:
			raise ValueError('invalid community name %s' % value)
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/configuration/static/parser.py/_community/swapped operands of `%`