def readline(self, size=DEFAULT):
        if self.mode in WRITE_MODES:
            raise IOError('Bad file descriptor')

        if size is not DEFAULT:
            size = self._check_int_argument(size)
            if size < 0:
                # treat negative integers the same as DEFAULT
                size = DEFAULT

        if self._position >= len(self._data):
            return ''

        position = self._position
        remaining = self._data[position:]
        poz = remaining.find('\n')

        if poz == -1:
            if size is DEFAULT or size > len(remaining):
                self._position = len(self._data)
                return remaining
            actual = remaining[:size]
            self._position += len(actual)
            return actual

        if size is DEFAULT:
            self._position = position + poz + 1
            return remaining[:poz + 1]

        actual = remaining[:poz + 1]
        if len(actual) <= size:
            self._position += len(actual)
            return actual
        self._position += size
        return actual[:size]
readline([size]) -> next line from the file, as a string.
dataset/ETHPy150Open mockfs/mockfs/mockfs/storage.py/file.readline