def METHOD_NAME(encoded: bytes):
    """Process the encoded data into CoAP-over-TCP messages, return them as
    a list and trailing (unrecognized / incomplete) data."""
    messages = []
    while True:
        size = aiocoap.transports.tcp._extract_message_size(encoded)
        if size is not None:
            size = sum(size)
        if size is None or size > len(encoded):
            return messages, encoded
        messages.append(aiocoap.transports.tcp._decode_message(encoded[:size]))
        encoded = encoded[size:]