def METHOD_NAME(self, m: int) -> Generator[None, None, bytes]:
    """
    Read a LF-terminated line from the stream.
    This is a generator-based coroutine.
    The return value includes the LF character.
    Args:
        m: maximum number bytes to read; this is a security limit.
    Raises:
        EOFError: if the stream ends without a LF.
        RuntimeError: if the stream ends in more than ``m`` bytes.
    """
    n = 0  # number of bytes to read
    p = 0  # number of bytes without a newline
    while True:
        n = self.buffer.find(b"\n", p) + 1
        if n > 0:
            break
        p = len(self.buffer)
        if p > m:
            raise RuntimeError(f"read {p} bytes, expected no more than {m} bytes")
        if self.eof:
            raise EOFError(f"stream ends after {p} bytes, before end of line")
        yield
    if n > m:
        raise RuntimeError(f"read {n} bytes, expected no more than {m} bytes")
    r = self.buffer[:n]
    del self.buffer[:n]
    return r