def _guess_type_from_validator(validator):
if isinstance(validator, _OptionalValidator):<EOL><INDENT>return _guess_type_from_validator(validator.validator)<EOL><DEDENT>elif isinstance(validator, _AndValidator):<EOL><INDENT>for v in validator.validators:<EOL><INDENT>typ = _guess_type_from_validator(v)<EOL>if typ is not None:<EOL><INDENT>return typ<EOL><DEDENT><DEDENT>return None<EOL><DEDENT>elif isinstance(validator, _InstanceOfValidator):<EOL><INDENT>return validator.type<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>
Utility method to return the declared type of an attribute or None. It handles _OptionalValidator and _AndValidator
in order to unpack the validators.

:param validator:
:return: the type of attribute declared in an inner 'instance_of' validator (if any is found, the first one is used)
or None if no inner 'instance_of' validator is found