#NEWLINE# @ classmethod #NEWLINE# def unpack( cls , data , negotiated ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# if cls . cached : #NEWLINE# #INDENT# if ( data == cls . previous ) : #NEWLINE# #INDENT# return cls . cached #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# attributes = cls ( ) . parse ( data , negotiated ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# attributes = cls ( ) . parse ( data , negotiated ) #NEWLINE# #UNINDENT# if ( ( Attribute . CODE . AS_PATH in attributes ) and ( Attribute . CODE . AS4_PATH in attributes ) ) : #NEWLINE# #INDENT# attributes . merge_attributes ( ) #NEWLINE# #UNINDENT# if ( ( Attribute . CODE . MP_REACH_NLRI not in attributes ) and ( Attribute . CODE . MP_UNREACH_NLRI not in attributes ) ) : #NEWLINE# #INDENT# cls . previous = data #NEWLINE# cls . cached = attributes #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cls . previous = '' #NEWLINE# cls . cached = None #NEWLINE# #UNINDENT# return attributes #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# raise Notify ( 3 , 2 , data )