def get_generic_type(obj):
gen_type = getattr(obj, '<STR_LIT>', None)<EOL>return gen_type if gen_type is not None else type(obj)<EOL>
Get the generic type of an object if possible, or runtime class otherwise.
    Examples::

        class Node(Generic[T]):
            ...
        type(Node[int]()) == Node
        get_generic_type(Node[int]()) == Node[int]
        get_generic_type(Node[T]()) == Node[T]
        get_generic_type(1) == int