def pop(self, idx=-<NUM_LIT:1>):
<EOL>if not self._len:<EOL><INDENT>raise IndexError('<STR_LIT>')<EOL><DEDENT>_lists = self._lists<EOL>if idx == <NUM_LIT:0>:<EOL><INDENT>val = _lists[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>self._delete(<NUM_LIT:0>, <NUM_LIT:0>)<EOL>return val<EOL><DEDENT>if idx == -<NUM_LIT:1>:<EOL><INDENT>pos = len(_lists) - <NUM_LIT:1><EOL>loc = len(_lists[pos]) - <NUM_LIT:1><EOL>val = _lists[pos][loc]<EOL>self._delete(pos, loc)<EOL>return val<EOL><DEDENT>if <NUM_LIT:0> <= idx < len(_lists[<NUM_LIT:0>]):<EOL><INDENT>val = _lists[<NUM_LIT:0>][idx]<EOL>self._delete(<NUM_LIT:0>, idx)<EOL>return val<EOL><DEDENT>len_last = len(_lists[-<NUM_LIT:1>])<EOL>if -len_last < idx < <NUM_LIT:0>:<EOL><INDENT>pos = len(_lists) - <NUM_LIT:1><EOL>loc = len_last + idx<EOL>val = _lists[pos][loc]<EOL>self._delete(pos, loc)<EOL>return val<EOL><DEDENT>pos, idx = self._pos(idx)<EOL>val = _lists[pos][idx]<EOL>self._delete(pos, idx)<EOL>return val<EOL>
Remove and return item at *idx* (default last).  Raises IndexError if
list is empty or index is out of range.  Negative indices are supported,
as for slice indices.