#NEWLINE# @ staticmethod #NEWLINE# def unpack( data , negotiated ) : #NEWLINE# #INDENT# communities = ExtendedCommunities ( ) #NEWLINE# while data : #NEWLINE# #INDENT# if ( data and ( len ( data ) < 8 ) ) : #NEWLINE# #INDENT# raise Notify ( 3 , 1 , ( 'could not decode extended community %s' % str ( [ hex ( ord ( _ ) ) for _ in data ] ) ) ) #NEWLINE# #UNINDENT# communities . add ( ExtendedCommunity . unpack ( data [ : 8 ] , negotiated ) ) #NEWLINE# data = data [ 8 : ] #NEWLINE# #UNINDENT# return communities