import re


def add_uuid_dashes(uuid):
    """Convert a plain UUID (i.e. "65ea51744ce54bee...") to a dashed
    UUID (i.e. 65ea5174-4ce5-4bee-...)
    """
    if uuid is None:
        return None
    else:
        p = re.compile(r"(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})")
        return p.sub(r"\1-\2-\3-\4-\5", uuid)