#NEWLINE# def __setitem__( self , key , value ) : #NEWLINE# #INDENT# self . _do_eviction_if_required ( ) #NEWLINE# if ( self . in_memory_format == IN_MEMORY_FORMAT . BINARY ) : #NEWLINE# #INDENT# value = self . serialization_service . to_data ( data_record ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . in_memory_format == IN_MEMORY_FORMAT . OBJECT ) : #NEWLINE# #INDENT# value = self . serialization_service . to_object ( value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'Invalid in-memory format!!!' ) #NEWLINE# #UNINDENT# #UNINDENT# data_record = DataRecord ( key , value , ttl_seconds = self . time_to_live_seconds ) #NEWLINE# super ( NearCache , self ) . __setitem__ ( key , data_record )