#NEWLINE# def encode( self , data ) : #NEWLINE# #INDENT# '\n        Encode ``data`` read from some I/O stream, into a useful str/bytes.\n        ' #NEWLINE# if ( not isinstance ( data , six . binary_type ) ) : #NEWLINE# #INDENT# data = data . encode ( self . encoding ) #NEWLINE# #UNINDENT# return data