def METHOD_NAME(data, attachment_type):
    cache_key = cache_key_for_event(data)
    attachments = attachment_cache.get(cache_key)
    return next((a for a in attachments if a.type == attachment_type), None)