def to_python(self, value):
        # Try to coerce the value to unicode.
        unicode_value = force_text(value, strings_only=True)
        if isinstance(unicode_value, six.text_type):
            value = unicode_value.strip()
        # If unicode, try to strptime against each input format.
        if isinstance(value, six.text_type):
            for format in self.input_formats:
                try:
                    return self.strptime(value, format)
                except (__HOLE__, TypeError):
                    continue
        raise ValidationError(self.error_messages['invalid'], code='invalid')
dataset/ETHPy150Open django/django/django/forms/fields.py/BaseTemporalField.to_python