def _getNumUniqueValues(values, bgVals):
    """Get the number of unique values connected to this junction.
       All background values are considered the same"""
    v, b = set(values), set(bgVals)
    return len(v.difference(b)) + (1 if v.intersection(b) else 0)
