def clean(self, value):
        if not value and not self.required:
            return None

        try:
            gid = from_global_id(value)
        except (TypeError, ValueError, UnicodeDecodeError, binascii.Error):
            raise ValidationError(self.error_messages['invalid'])

        try:
            IntegerField().clean(gid.id)
            CharField().clean(gid.type)
        except ValidationError:
            raise ValidationError(self.error_messages['invalid'])

        return value
dataset/ETHPy150Open graphql-python/graphene/graphene/contrib/django/forms.py/GlobalIDFormField.clean/original