def insert(self, index, key, value):
if key in self.keyOrder:<EOL><INDENT>n = self.keyOrder.index(key)<EOL>del self.keyOrder[n]<EOL>if n < index:<EOL><INDENT>index -= <NUM_LIT:1><EOL><DEDENT><DEDENT>self.keyOrder.insert(index, key)<EOL>super(SortedDict, self).__setitem__(key, value)<EOL>
Inserts the key, value pair before the item with the given index.