def to_python(self, value):
        value = super(UUIDField, self).to_python(value)
        if self.empty_values in value:
            return None
        if not isinstance(value, uuid.UUID):
            try:
                value = uuid.UUID(value)
            except ValueError:
                raise ValidationError(self.error_messages['invalid'], code='invalid')
        return value
dataset/ETHPy150Open django/django/django/forms/fields.py/UUIDField.to_python/swapped operands of `in`