@classmethod
    def validate_attributes(cls, data, models=None, force=False):
        for attrs in six.itervalues(data):
            if not isinstance(attrs, dict):
                continue
            for attr_name, attr in six.iteritems(attrs):
                cls.validate_attribute(attr_name, attr)

        # If settings are present restrictions can be checked
        if models and not force:
            restrict_err = restrictions.AttributesRestriction.check_data(
                models, data)
            if restrict_err:
                raise errors.InvalidData(
                    "Some restrictions didn't pass verification: {}"
                    .format(restrict_err))
        return data
Validate attributes.
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/api/v1/validators/base.py/BasicAttributesValidator.validate_attributes