def METHOD_NAME(transport, timeout_sec: int) -> str:
    data = bytearray()
    while True:
        new_data = transport.read(1, timeout_sec=timeout_sec)
        logging.debug("read data: %s", new_data)
        for item in new_data:
            data.append(item)
            if str(chr(item)) == "\n":
                return data.decode(encoding="utf-8")