def _get_offset(self, index):
if not self._in_range(index):<EOL><INDENT>raise IndexError('<STR_LIT>')<EOL><DEDENT>if isinstance(index, slice):<EOL><INDENT>index = slice(index.start - self.start, index.stop - self.start)<EOL><DEDENT>else:<EOL><INDENT>index -= self.start<EOL><DEDENT>return index<EOL>
Translates the index to the internal offsets.

self.start   -> 0
self.start+1 -> 1
...
self.end     -> len(self)