def _pos(self, idx):
if idx < <NUM_LIT:0>:<EOL><INDENT>last_len = len(self._lists[-<NUM_LIT:1>])<EOL>if (-idx) <= last_len:<EOL><INDENT>return len(self._lists) - <NUM_LIT:1>, last_len + idx<EOL><DEDENT>idx += self._len<EOL>if idx < <NUM_LIT:0>:<EOL><INDENT>raise IndexError('<STR_LIT>')<EOL><DEDENT><DEDENT>elif idx >= self._len:<EOL><INDENT>raise IndexError('<STR_LIT>')<EOL><DEDENT>if idx < len(self._lists[<NUM_LIT:0>]):<EOL><INDENT>return <NUM_LIT:0>, idx<EOL><DEDENT>_index = self._index<EOL>if not _index:<EOL><INDENT>self._build_index()<EOL><DEDENT>pos = <NUM_LIT:0><EOL>child = <NUM_LIT:1><EOL>len_index = len(_index)<EOL>while child < len_index:<EOL><INDENT>index_child = _index[child]<EOL>if idx < index_child:<EOL><INDENT>pos = child<EOL><DEDENT>else:<EOL><INDENT>idx -= index_child<EOL>pos = child + <NUM_LIT:1><EOL><DEDENT>child = (pos << <NUM_LIT:1>) + <NUM_LIT:1><EOL><DEDENT>return (pos - self._offset, idx)<EOL>
Convert an index into a pair (alpha, beta) that can be used to access
        the corresponding _lists[alpha][beta] position.

        Most queries require the index be built. Details of the index are
        described in self._build_index.

        Indexing requires traversing the tree to a leaf node. Each node has
        two children which are easily computable. Given an index, pos, the
        left-child is at pos * 2 + 1 and the right-child is at pos * 2 + 2.

        When the index is less than the left-child, traversal moves to the
        left sub-tree. Otherwise, the index is decremented by the left-child
        and traversal moves to the right sub-tree.

        At a child node, the indexing pair is computed from the relative
        position of the child node as compared with the offset and the remaining
        index.

        For example, using the index from self._build_index:

        _index = 14 5 9 3 2 4 5
        _offset = 3

        Tree:

                 14
              5      9
            3   2  4   5

        Indexing position 8 involves iterating like so:

        1. Starting at the root, position 0, 8 is compared with the left-child
           node (5) which it is greater than. When greater the index is
           decremented and the position is updated to the right child node.

        2. At node 9 with index 3, we again compare the index to the left-child
           node with value 4. Because the index is the less than the left-child
           node, we simply traverse to the left.

        3. At node 4 with index 3, we recognize that we are at a leaf node and
           stop iterating.

        4. To compute the sublist index, we subtract the offset from the index
           of the leaf node: 5 - 3 = 2. To compute the index in the sublist, we
           simply use the index remaining from iteration. In this case, 3.

        The final index pair from our example is (2, 3) which corresponds to
        index 8 in the sorted list.