def clean_optional_decode_key(self):
        optional_decode_key = self.cleaned_data['optional_decode_key'].strip()
        if optional_decode_key:
            if len(optional_decode_key) != 64:
                raise ValidationError('Invalid length for decode key !')
            try:
                decode_key = optional_decode_key.decode('hex')
            except TypeError as e:
                raise ValidationError('Cannot convert to binary: %r' % e.msg)

            return decode_key
dataset/ETHPy150Open ionelmc/django-monkey-team/src/monkey_team/forms.py/DecodeForm.clean_optional_decode_key/original