import re


def present(incomingString):
    """
    Return a tuple containing a list of all single-dollar and a list of all 
    double-dollar variables present in the given string.
    """
    # Build a list of single-dollar-signed variables without duplicates
    presentSingleList = list()
    singleDollars = re.compile(r"((?<!\\)(?<!\$)\${1}(?!\$)[A-Z0-9_]*)")
    for match in singleDollars.finditer(incomingString):
        variableName = match.group()[1:]
        presentSingleList.append(variableName)
    presentSingleList = list(set(presentSingleList))

    # Build a list of double-dollar-signed variables without duplicates
    presentDoubleList = list()
    doubleDollars = re.compile(r"((?<!\\)(?<!\$)\${2}(?!\$)[A-Z0-9_]*)")
    for match in doubleDollars.finditer(incomingString):
        variableName = match.group()[2:]
        presentDoubleList.append(variableName)
    presentDoubleList = list(set(presentDoubleList))

    return (presentSingleList, presentDoubleList)