def has_inherited_table(cls):
    for class_ in cls.__mro__[1:]:
        if getattr(class_, '__table__', None) is not None:
            return True
    return False
Given a class, return True if any of the classes it inherits from has a
dataset/ETHPy150Open zzzeek/sqlalchemy/lib/sqlalchemy/ext/declarative/api.py/has_inherited_table