import re


def createAlias(name):
    """
    Map MySQL field names to the descriptive part of the name.

    name : str
        A MySQL field.  It is assumed that this is begins either "FLD_"
        (if this should be a field of the base PV) or "PV_" (if this is
        an extension of the base PV).

    Returns
    -------
    desc : str
        Remove the prefix "FLD_" or "PV_" from name and replace "__" with "_".
    """
    name = re.sub("__", "_", name)
    if name[:3] == "PV_":
        return name[3:]
    if name[:4] == "FLD_":
        return name[4:]
    else:
        return name