def is_valid_pep484_type_hint(typ_hint, allow_forward_refs: bool = False):
<EOL>try:<EOL><INDENT>if isinstance(typ_hint, type):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>if allow_forward_refs and is_forward_ref(typ_hint):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>return is_union_type(typ_hint) or is_typevar(typ_hint)<EOL><DEDENT>except:<EOL><INDENT>return False<EOL><DEDENT>
Returns True if the provided type is a valid PEP484 type hint, False otherwise.

Note: string type hints (forward references) are not supported by default, since callers of this function in
parsyfiles lib actually require them to be resolved already.

:param typ_hint:
:param allow_forward_refs:
:return: