#NEWLINE# def dbsafe_encode( value , compress_object = False , pickle_protocol = DEFAULT_PROTOCOL ) : #NEWLINE# #INDENT# if ( not compress_object ) : #NEWLINE# #INDENT# value = b64encode ( dumps ( deepcopy ( value ) , pickle_protocol ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# value = b64encode ( compress ( dumps ( deepcopy ( value ) , pickle_protocol ) ) ) #NEWLINE# #UNINDENT# return PickledObject ( compress_object )