def parse_logs(response):
    """Parse the Docker logs into stdout and stderr string lists"""
    # Parse each line into a log, skip the empty lines
    lines = list(filter(None, response.text.split('\n')))
    stdout_logs = []
    stderr_logs = []

    for line in lines:
        # Byte format documentation
        # https://docs.docker.com/engine/api/v1.40/#operation/ContainerAttach
        log_bytes = bytes(line, 'utf8')
        stream_type = log_bytes[0]
        log_message = line[8:]

        if stream_type == 0:
            print('Warning: Received a stdin log?')
        elif stream_type == 1:
            stdout_logs.append(log_message)
        elif stream_type == 2:
            stderr_logs.append(log_message)

    return [stdout_logs, stderr_logs]