def _check_set(set_, value):
    """Return true if *value* is a member of the given set or if
    the *value* is equal to the given set.
    """
    try:
        return value in set_ or value == set_
    except TypeError:
        return False
