<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_line_for_offset(self, code_offset):
 """ returns the line number given a code offset """


        prev_line = 0

        for (offset, line) in self.get_linenumbertable():
            if offset < code_offset:
                prev_line = line
            elif offset == code_offset:
                return line
            else:
                return prev_line

        return prev_line