def validate(self, value):
        val = super(UUID, self).validate(value)
        if val is None:
            return
        if isinstance(val, _UUID):
            return val
        if isinstance(val, six.string_types):
            try:
                return _UUID(val)
            except __HOLE__:
                # fall-through to error
                pass
        raise ValidationError("{0} {1} is not a valid uuid".format(
            self.column_name, value))
dataset/ETHPy150Open datastax/python-driver/cassandra/cqlengine/columns.py/UUID.validate