'Takes a singular table name, table name, or table object and returns
the table name.
Returns None for a bogus name.'

def _parse_table_name(self, name):

    if hasattr(name, '__tablename__'):
        return getattr(name, '__tablename__')
    for table in self.indexed_tables.values():
        if (name in (table.__tablename__, table.__singlename__)):
            return table.__tablename__
    return None
