def set_item(self, key, value):
keys = list(self.keys())<EOL>if key in keys:<EOL><INDENT>self.set_value(<NUM_LIT:1>,keys.index(key),str(value))<EOL><DEDENT>else:<EOL><INDENT>self.set_value(<NUM_LIT:0>,len(self),   str(key))<EOL>self.set_value(<NUM_LIT:1>,len(self)-<NUM_LIT:1>, str(value))<EOL><DEDENT>
Sets the item by key, and refills the table sorted.