#NEWLINE# def transfer_encode( encoding , payload ) : #NEWLINE# #INDENT# encoding = encoding . lower ( ) #NEWLINE# if ( encoding == 'base64' ) : #NEWLINE# #INDENT# return _bencode ( payload ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( encoding == 'quoted-printable' ) : #NEWLINE# #INDENT# return _qencode ( payload ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RuntimeError ( ( 'Unknown transfer encoding %s' % payload ) )