<s> from io import BytesIO <EOL> from . . import KeyValueStore <EOL> class DictStore ( KeyValueStore ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , d = None ) : <EOL> self . d = d or { } <EOL> def _delete ( self , key ) : <EOL> self . d . pop ( key , None ) <EOL> def _has_key ( self , key ) : <EOL> return key in self . d <EOL> def _open ( self , key ) : <EOL> return BytesIO ( self . d [ key ] ) <EOL> def _put_file ( self , key , file ) : <EOL> self . d [ key ] = file . read ( ) <EOL> return key <EOL> def iter_keys ( self ) : <EOL> return iter ( self . d ) </s>
