@classmethod
	def unpack (cls, data, negotiated):
		try:
			if cls.cached:
				if data == cls.previous:
					return cls.cached
				# # This code may mess with the cached data
				# elif cls.previous and data.startswith(cls.previous):
				# 	attributes = Attributes()
				# 	for key in cls.cached:
				# 		attributes[key] = cls.cached[key]
				# 	attributes.parse(data[len(cls.previous):],negotiated)
				else:
					attributes = cls().parse(data,negotiated)
			else:
				attributes = cls().parse(data,negotiated)

			if Attribute.CODE.AS_PATH in attributes and Attribute.CODE.AS4_PATH in attributes:
				attributes.merge_attributes()

			if Attribute.CODE.MP_REACH_NLRI not in attributes and Attribute.CODE.MP_UNREACH_NLRI not in attributes:
				cls.previous = data
				cls.cached = attributes
			else:
				cls.previous = ''
				cls.cached = None

			return attributes
		except __HOLE__:
			raise Notify(3,2,data)
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/bgp/message/update/attribute/attributes.py/Attributes.unpack