import re


def parse_mention(text):
    """
    Finds direct mentions (mentions at the front of a message)
    text - a dictionary containing slack event information
    Returns an 2 element tuple of [USER_ID, rest_of_message]
    """

    matches = re.search("^<@(|[WU].+?)>(.*)", text)
    # the first group contains the username, the second group contains the remaining message
    return (matches.group(1), matches.group(2).strip()) if matches else (None, None)