def single_from(iterable):
    """Check that an iterable contains one unique value, and return it."""
    unique_vals = set(iterable)
    if len(unique_vals) != 1:
        raise ValueError('multiple unique values found')
    return unique_vals.pop()