def check_type(self, value, attr, data):
expected_types = self._expected_types()<EOL>if not isinstance(value, expected_types):<EOL><INDENT>raise self._not_expected_type(<EOL>value, expected_types, fields=[self], field_names=attr, data=data)<EOL><DEDENT>return value<EOL>
Validates a value against the correct type of the field.

        It calls ``_expected_types`` to get a list of valid types.

        Subclasses can do one of the following:

            1. They can override the ``valid_types`` property with a tuple with
            the expected types for this field.

            2. They can override the ``_expected_types`` method to return a
            tuple of expected types for the field.

            3. They can change ``check_type`` completely to customize
            validation.

        This method or the overrides must return the ``value`` parameter
        untouched.