def get_validated_type(object_type: Type[Any], name: str, enforce_not_joker: bool = True) -> Type[Any]:
if object_type is object or object_type is Any or object_type is AnyObject:<EOL><INDENT>return AnyObject<EOL><DEDENT>else:<EOL><INDENT>if object_type is JOKER:<EOL><INDENT>if enforce_not_joker:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>check_var(object_type, var_types=type, var_name=name)<EOL><DEDENT>return object_type<EOL><DEDENT>
Utility to validate a type :
* None is not allowed,
* 'object', 'AnyObject' and 'Any' lead to the same 'AnyObject' type
* JOKER is either rejected (if enforce_not_joker is True, default) or accepted 'as is'

:param object_type: the type to validate
:param name: a name used in exceptions if any
:param enforce_not_joker: a boolean, set to False to tolerate JOKER types
:return: the fixed type