def find_tables(clause, check_columns=False, include_aliases=False, include_joins=False, include_selects=False, include_crud=False):
 tables = []
 _visitors = {}
 if include_selects:
  _visitors['select'] = _visitors['compound_select'] = tables.append
 if include_joins:
  _visitors['join'] = tables.append
 if include_aliases:
  _visitors['alias'] = tables.append
 if include_crud:
  _visitors['insert'] = _visitors['update'] = _visitors['delete'] = (lambda ent: tables.append(ent.table))
 if check_columns:
  def visit_column(column):
   tables.append(column.table)
  _visitors['column'] = visit_column
 _visitors['table'] = tables.append
 visitors.traverse(clause, {'column_collections': False}, _visitors)
 return tables

def find_tables ( clause , check_columns = False , include_aliases = False , include_joins = False , include_selects = False , include_crud = False ) : tables = [ ] _visitors = { } if include_selects : _visitors [ 'select' ] = _visitors [ 'compound_select' ] = tables . append if include_joins : _visitors [ 'join' ] = tables . append if include_aliases : _visitors [ 'alias' ] = tables . append if include_crud : _visitors [ 'insert' ] = _visitors [ 'update' ] = _visitors [ 'delete' ] = ( lambda ent : tables . append ( ent . table ) ) if check_columns : def visit_column ( column ) : tables . append ( column . table ) _visitors [ 'column' ] = visit_column _visitors [ 'table' ] = tables . append visitors . traverse ( clause , { 'column_collections' : False } , _visitors ) return tables
locate table objects within the given expression .