def get_validated_types(object_types: Set[Type], set_name: str) -> Set[Type]:
check_var(object_types, var_types=set, var_name=set_name)<EOL>res = {get_validated_type(typ, set_name + '<STR_LIT>') for typ in object_types}<EOL>if AnyObject in res and len(res) > <NUM_LIT:1>:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>return res<EOL><DEDENT>
Utility to validate a set of types :
* None is not allowed as a whole or within the set,
* object and Any are converted into AnyObject
* if AnyObject is in the set, it must be the only element

:param object_types: the set of types to validate
:param set_name: a name used in exceptions if any
:return: the fixed set of types