def has_snapshot_with_attributes(snapshots, attrs):
    """ Test if a snapshot with the given subset of attributes exists """

    def dict_contains(a, b):
        for k in b.keys():
            if (a.get(k) != b.get(k)):
                return False
        return True

    for s in snapshots:
        if (dict_contains(s, attrs)):
            return True

    return False