def removeAliasedValues(enum):
    valueByName = {}
    for (name, value) in enum.values:
        valueByName[name] = value

    def removeDefExtPostfix(name):
        for extPostfix in EXTENSION_POSTFIXES:
            if endsWith(name, ('_' + extPostfix)):
                return name[0:(- (len(extPostfix) + 1))]
        return None
    newValues = []
    for (name, value) in enum.values:
        withoutPostfix = removeDefExtPostfix(name)
        if ((withoutPostfix != None) and (withoutPostfix in valueByName) and (valueByName[withoutPostfix] == value)):
            continue
        newValues.append((name, value))
    enum.values = newValues
def removeAliasedValues(enum):
    valueByName = {}
    for (name, value) in enum.values:
        valueByName[name] = value

    def removeDefExtPostfix(name):
        for extPostfix in EXTENSION_POSTFIXES:
            if endsWith(name, ('_' + extPostfix)):
                return name[0:(- (len(extPostfix) + 1))]
        return None
    newValues = []
    for (name, value) in enum.values:
        withoutPostfix = removeDefExtPostfix(name)
        if ((withoutPostfix != None) and (withoutPostfix in valueByName) and (valueByName[withoutPostfix] == value)):
            continue
        newValues.append((name, value))
    enum.values = newValues