def set(self, key, value):
if self.in_memory:<EOL><INDENT>self._memory_db[key] = value<EOL><DEDENT>else:<EOL><INDENT>db = self._read_file()<EOL>db[key] = value<EOL>with open(self.db_path, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(json.dumps(db, ensure_ascii=False, indent=<NUM_LIT:2>))<EOL><DEDENT><DEDENT>
Set key value