def head(self, lines=10):
        """\
        Return the top lines of the file.
        """
        self.seek(0)

        for i in range(lines):
            if not self.seek_line_forward():
                break
    
        end_pos = self.file.tell()
        
        self.seek(0)
        data = self.file.read(end_pos - 1)

        if data:
            return self.splitlines(data)
        else:
            return []
def head ( self , lines = 10 ) : self . seek ( 0 ) for i in range ( lines ) : if not self . seek_line_forward ( ) : break end_pos = self . file . tell ( ) self . seek ( 0 ) data = self . file . read ( end_pos - 1 ) if data : return self . splitlines ( data ) else : return [ ]
\
        Return the top lines of the file.