Return index of start of last line stored in self.buf.
        This function never fetches more data from the file; therefore,
        if it returns zero, meaning the line starts at the beginning of the
        buffer, the caller should then fetch more data and retry.

def get_start_of_line(self):
        """Return index of start of last line stored in self.buf.
        This function never fetches more data from the file; therefore,
        if it returns zero, meaning the line starts at the beginning of the
        buffer, the caller should then fetch more data and retry.
        """
        if self.newline in ('\r', '\n', '\r\n'):
            return self.buf.rfind(self.newline.encode('ascii'), 0, -1) + 1
        if self.newline:
            raise ValueError(r"ropen newline argument must be one of "
                             r"None, '', '\r', '\n', '\r\n'.")

        # self.newline is None or ''; universal newlines mode
        end_of_search = -1
        if len(self.buf) >= 2 and self.buf[-2:] == b'\r\n':
            end_of_search = -2
        return max(self.buf.rfind(b'\n', 0, end_of_search),
                   self.buf.rfind(b'\r', 0, end_of_search)) + 1