def validate(self, value, required=True):
        value = super(DictProperty, self).validate(value, required=required)
        if value and value is not None:
            if not isinstance(value, dict):
                raise BadValueError('Property %s must be a dict' % self.name)
            value = self.validate_dict_contents(value)
        return value
dataset/ETHPy150Open benoitc/couchdbkit/couchdbkit/schema/properties.py/DictProperty.validate/original