<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def read(self, size=-1):
        "Reads up to size bytes, but always completes the last line."
        buf = self.fin.read(size)
        if not buf:
            return ''
        lines = buf.splitlines()
        # Read the rest of the last line if necessary
        if not buf.endswith('\n'):
            last = lines.pop()
            partial = self.fin.readline()
            lines.append(last + partial)
        # Process the lines, concatenate them
        lines = [self.process_line(line.rstrip('\n')) for line in lines]
        return ''.join(lines)