#NEWLINE# def bytes_to_str( value , encoding = 'utf-8' ) : #NEWLINE# #INDENT# if ( isinstance ( value , string_types ) or ( value is None ) ) : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( value , list ) : #NEWLINE# #INDENT# return [ bytes_to_str ( elem ) for elem in value ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return value . decode ( value )