human
Write me a the Python program you requested given the following:
I am working on the file "L1 - List Intersection.ipynb".
The first task is:
The InvertedList class
We implement this class which encapsulates all the important operations one can perform on an inverted list.
Can you write Python program for it?
assistant
#Here is the Python program you requested.

from pprint import pprint
from bisect import *

## You may find many similarity between this class and the file operation (in C/Java). 
class InvertedList:
    def __init__(self, l):
        self.data = l[:] # make a copy
        self.cur = 0     # the cursor 

    def get_list(self):
        return self.data
 
    def eol(self):
        # we use cur == len(list) to indicate EOL
        return False if self.cur < len(self.data) else True
    
    def next(self, val = 1):
        # does not allow cur to be out-of-range, but use len(list) to indicate EOL
        self.cur = min(self.cur + val, len(self.data)) 
            
    def elem(self):
        if self.eol():
            return None
        else: 
            return self.data[self.cur]

    def peek(self, pos):
        # look at the element under the current cursor, but does not advance the cursor. 
        if pos < len(self.data):
            return self.data[pos]
        else:
            return None
        
    def reset(self):
        self.cur = 0
    
    def dump(self):
        print("* {} : {} (cur = {})".format(self.data[:self.cur], self.data[self.cur:], self.cur))
        
    def skip_to(self, val):
        ##!! This is a naive and inefficient implementation. 
        ##!! Once you have implemented gallop_to(), you can just call it here instead.
        # move the cursor to the first element no smaller than `val`

        while not self.eol() and self.elem() < val:
            self.next()               
            
    def gallop_to(self, val):
        ##!! Not implemented yet. 
        pass