#NEWLINE# def encode( self , encodeFun , value , defMode , maxChunkSize ) : #NEWLINE# #INDENT# ( substrate , isConstructed ) = self . encodeValue ( encodeFun , value , defMode , maxChunkSize ) #NEWLINE# tagSet = value . getTagSet ( ) #NEWLINE# if tagSet : #NEWLINE# #INDENT# if ( not isConstructed ) : #NEWLINE# #INDENT# defMode = 1 #NEWLINE# #UNINDENT# return ( ( ( self . encodeTag ( tagSet [ ( - 1 ) ] , isConstructed ) + self . encodeLength ( len ( substrate ) , defMode ) ) + substrate ) + self . _encodeEndOfOctets ( maxChunkSize , defMode ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return substrate