def is_tuple_type(tp):
if NEW_TYPING:<EOL><INDENT>return (tp is Tuple or isinstance(tp, _GenericAlias) and<EOL>tp.__origin__ is tuple or<EOL>isinstance(tp, type) and issubclass(tp, Generic) and<EOL>issubclass(tp, tuple))<EOL><DEDENT>return type(tp) is TupleMeta<EOL>
Test if the type is a generic tuple type, including subclasses excluding
    non-generic classes.
    Examples::

        is_tuple_type(int) == False
        is_tuple_type(tuple) == False
        is_tuple_type(Tuple) == True
        is_tuple_type(Tuple[str, int]) == True
        class MyClass(Tuple[str, int]):
            ...
        is_tuple_type(MyClass) == True

    For more general tests use issubclass(..., tuple), for more precise test
    (excluding subclasses) use::

        get_origin(tp) is tuple  # Tuple prior to Python 3.7