from typing import List
import pickle
import zlib
import base64


def deserialize_email_messages(messages: List[str]):
    """Deserialize EmailMessages passed as task argument."""
    return [
        pickle.loads(zlib.decompress(base64.b64decode(m)))
        for m in messages
    ]