def check_type(self, value, attr, data):
if self.many and not is_collection(value):<EOL><INDENT>raise self._not_expected_type(<EOL>value, Iterable, fields=[self], field_names=attr, data=data)<EOL><DEDENT>_check_type = super().check_type<EOL>errors = []<EOL>values = value if self.many else [value]<EOL>for idx, v in enumerate(values):<EOL><INDENT>try:<EOL><INDENT>_check_type(v, idx, values)<EOL><DEDENT>except ValidationError as err:<EOL><INDENT>errors.append(err.messages)<EOL><DEDENT><DEDENT>if errors:<EOL><INDENT>errors = errors if self.many else errors[<NUM_LIT:0>]<EOL>raise ValidationError(errors)<EOL><DEDENT>return value<EOL>
Validate if the value is of the type of the schema's model.

        Assumes the nested schema is a ``BaseSchema``.