def is_valid_bucket(bucket, new_settings, new_constraints):
    """
    Determine if bucket is valid for new settings under constraints.

    Note that this is best-effort only: if it returns True then an overlap
    _is_ safe; if it does not then an overlap _may_ be unsafe.
    """
    existing = bucket.affected_settings_by_constraints()
    for constraints, settings in existing.items():
        settings_disjoint = frozenset.isdisjoint(settings, new_settings)
        constraints_disjoint = (constraints.
            is_provably_disjoint_from_constraints(new_constraints))
        if not (constraints_disjoint or settings_disjoint):
            return False
    return True
