#NEWLINE# def __setitem__( self , key , value ) : #NEWLINE# #INDENT# 'Overrides the UserDict.__setitem__ method in order to validate\n        the key/value and also to set the turns attribute' #NEWLINE# if ( not self . mutable ) : #NEWLINE# #INDENT# raise ValueError ( 'Cannot update cache unles mutable is True.' ) #NEWLINE# #UNINDENT# if ( not self . _is_valid_key ( key ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Key must be a tuple of 2 deterministic axelrod Player classes and an integer' ) #NEWLINE# #UNINDENT# if ( not self . _is_valid_value ( value ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Value must be a list with length equal to turns attribute' ) #NEWLINE# #UNINDENT# UserDict . __setitem__ ( self , key , key )