def __getitem__(self, idx):
_lists = self._lists<EOL>if isinstance(idx, slice):<EOL><INDENT>start, stop, step = idx.indices(self._len)<EOL>if step == <NUM_LIT:1> and start < stop:<EOL><INDENT>if start == <NUM_LIT:0> and stop == self._len:<EOL><INDENT>return reduce(iadd, self._lists, [])<EOL><DEDENT>start_pos, start_idx = self._pos(start)<EOL>if stop == self._len:<EOL><INDENT>stop_pos = len(_lists) - <NUM_LIT:1><EOL>stop_idx = len(_lists[stop_pos])<EOL><DEDENT>else:<EOL><INDENT>stop_pos, stop_idx = self._pos(stop)<EOL><DEDENT>if start_pos == stop_pos:<EOL><INDENT>return _lists[start_pos][start_idx:stop_idx]<EOL><DEDENT>prefix = _lists[start_pos][start_idx:]<EOL>middle = _lists[(start_pos + <NUM_LIT:1>):stop_pos]<EOL>result = reduce(iadd, middle, prefix)<EOL>result += _lists[stop_pos][:stop_idx]<EOL>return result<EOL><DEDENT>if step == -<NUM_LIT:1> and start > stop:<EOL><INDENT>result = self._getitem(slice(stop + <NUM_LIT:1>, start + <NUM_LIT:1>))<EOL>result.reverse()<EOL>return result<EOL><DEDENT>indices = range(start, stop, step)<EOL>return list(self._getitem(index) for index in indices)<EOL><DEDENT>else:<EOL><INDENT>if self._len:<EOL><INDENT>if idx == <NUM_LIT:0>:<EOL><INDENT>return _lists[<NUM_LIT:0>][<NUM_LIT:0>]<EOL><DEDENT>elif idx == -<NUM_LIT:1>:<EOL><INDENT>return _lists[-<NUM_LIT:1>][-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise IndexError('<STR_LIT>')<EOL><DEDENT>if <NUM_LIT:0> <= idx < len(_lists[<NUM_LIT:0>]):<EOL><INDENT>return _lists[<NUM_LIT:0>][idx]<EOL><DEDENT>len_last = len(_lists[-<NUM_LIT:1>])<EOL>if -len_last < idx < <NUM_LIT:0>:<EOL><INDENT>return _lists[-<NUM_LIT:1>][len_last + idx]<EOL><DEDENT>pos, idx = self._pos(idx)<EOL>return _lists[pos][idx]<EOL><DEDENT>
Return the element at *idx*. Supports slicing.