def popitem(self, last=True):
if not self:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>root = self.__root<EOL>if last:<EOL><INDENT>link = root[<NUM_LIT:0>]<EOL>link_prev = link[<NUM_LIT:0>]<EOL>link_prev[<NUM_LIT:1>] = root<EOL>root[<NUM_LIT:0>] = link_prev<EOL><DEDENT>else:<EOL><INDENT>link = root[<NUM_LIT:1>]<EOL>link_next = link[<NUM_LIT:1>]<EOL>root[<NUM_LIT:1>] = link_next<EOL>link_next[<NUM_LIT:0>] = root<EOL><DEDENT>key = link[<NUM_LIT:2>]<EOL>del self.__map[key]<EOL>value = dict.pop(self, key)<EOL>return key, value<EOL>
od.popitem() -> (k, v), return and remove a (key, value) pair.
        Pairs are returned in LIFO order if last is true or FIFO order if false.