def __new__(cls, clsname, bases, dct):
    for setname in cls.sets:
        if (setname not in dct):
            dct[setname] = set()
        dct[setname] = set.union(dct[setname], *(getattr(base, setname) for base in bases if hasattr(base, setname)))
    for dictname in cls.dicts:
        if (dictname not in dct):
            dct[dictname] = {}
        for base in bases:
            if (not hasattr(base, dictname)):
                continue
            newdict = getattr(base, dictname)
            for key in (set(newdict) & set(dct[dictname])):
                if (newdict[key] != dct[dictname][key]):
                    raise ValueError('Inconsistent values of defaults[{}]: {}, {}'.format(key, newdict[key], dct[dictname][key]))
            dct[dictname].update(newdict)
    for setname in cls.sets:
        if (('remove' + setname) not in dct):
            dct[('remove' + setname)] = set()
        dct[('remove' + setname)] = set.union(dct[('remove' + setname)], *(getattr(base, ('remove' + setname)) for base in bases if hasattr(base, ('remove' + setname))))
        dct[setname] -= dct[('remove' + setname)]
    return super(ValidationMetaClass, cls).__new__(cls, clsname, bases, dct)
def __new__(cls, clsname, bases, dct):
    for setname in cls.sets:
        if (setname not in dct):
            dct[setname] = set()
        dct[setname] = set.union(dct[setname], *(getattr(base, setname) for base in bases if hasattr(base, setname)))
    for dictname in cls.dicts:
        if (dictname not in dct):
            dct[dictname] = {}
        for base in bases:
            if (not hasattr(base, dictname)):
                continue
            newdict = getattr(base, dictname)
            for key in (set(newdict) & set(dct[dictname])):
                if (newdict[key] != dct[dictname][key]):
                    raise ValueError('Inconsistent values of defaults[{}]: {}, {}'.format(key, newdict[key], dct[dictname][key]))
            dct[dictname].update(newdict)
    for setname in cls.sets:
        if (('remove' + setname) not in dct):
            dct[('remove' + setname)] = set()
        dct[('remove' + setname)] = set.union(dct[('remove' + setname)], *(getattr(base, ('remove' + setname)) for base in bases if hasattr(base, ('remove' + setname))))
        dct[setname] -= dct[('remove' + setname)]
    return super(ValidationMetaClass, cls).__new__(cls, clsname, bases, dct)