#NEWLINE# def _cast_to_type( data , type_cast ) : #NEWLINE# #INDENT# if isinstance ( data , ( list , tuple ) ) : #NEWLINE# #INDENT# return [ _cast_to_type ( x , type_cast ) for x in data ] #NEWLINE# #UNINDENT# if ( data == str ) : #NEWLINE# #INDENT# return force_text ( data ) #NEWLINE# #UNINDENT# return type_cast ( data )