def update_mapping(ex, exp, base=None):
    if (ex in mapping):
        return symbols[ex]
    a = next(generator)
    symbols[ex] = a
    if (base is not None):
        mapping[ex] = ((a ** exp) + base)
    else:
        mapping[ex] = exp.as_expr(a)
    return a
def update_mapping(ex, exp, base=None):
    if (ex in mapping):
        return symbols[ex]
    a = next(generator)
    symbols[ex] = a
    if (base is not None):
        mapping[ex] = ((a ** exp) + base)
    else:
        mapping[ex] = exp.as_expr(a)
    return a