def is_collection(object_type, strict: bool = False) -> bool:
if object_type is None or object_type is Any or is_union_type(object_type) or is_typevar(object_type):<EOL><INDENT>return False<EOL><DEDENT>elif strict:<EOL><INDENT>return object_type == dictor object_type == listor object_type == tupleor object_type == setor get_base_generic_type(object_type) == Dictor get_base_generic_type(object_type) == Listor get_base_generic_type(object_type) == Setor get_base_generic_type(object_type) == Tuple<EOL><DEDENT>else:<EOL><INDENT>return issubclass(object_type, Dict)or issubclass(object_type, List)or issubclass(object_type, Set)or issubclass(object_type, Tuple)or issubclass(object_type, dict)or issubclass(object_type, list)or issubclass(object_type, tuple)or issubclass(object_type, set)<EOL><DEDENT>
Utility method to check if a type is a subclass of typing.{List,Dict,Set,Tuple}
or of list, dict, set, tuple.

If strict is set to True, the method will return True only if the class IS directly one of the base collection
classes

:param object_type:
:param strict: if set to True, this method will look for a strict match.
:return: