#NEWLINE# def extendedcommunity( data ) : #NEWLINE# #INDENT# if integer ( data ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if ( string ( data ) and ( data . count ( ':' ) == 2 ) ) : #NEWLINE# #INDENT# ( _ , __ , ___ ) = data . split ( ':' ) #NEWLINE# if ( _ . lower ( ) not in ( 'origin' , 'target' ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return ( ( __ . isdigit ( ) and asn16 ( __ ) and ipv4 ( ___ ) ) or ( ipv4 ( __ ) and ___ . isdigit ( ) and asn16 ( ___ ) ) ) #NEWLINE# #UNINDENT# return False