miror a set of `tables` from `dest_url`

        Returns a new Genome object

        Parameters
        ----------

        tables : list
            an iterable of tables

        dest_url: str
            a dburl string, e.g. 'sqlite:///local.db'
437302
def mirror(self, tables, dest_url):
        
        from mirror import mirror
        return mirror(self, tables, dest_url)
1238972
def get_tables_for_query(query):
    
    from django.db.models.sql.where import WhereNode, SubqueryConstraint
    from django.db.models.query import QuerySet
    tables = set([v[0] for v in getattr(query,'alias_map',{}).values()])

    def get_sub_query_tables(node):
        query = node.query_object
        if not hasattr(query, 'field_names'):
            query = query.values(*node.targets)
        else:
            query = query._clone()
        query = query.query
        return set(v[0] for v in getattr(query, 'alias_map',{}).values())

    def get_tables(node, tables):
        if isinstance(node, SubqueryConstraint):
            return get_sub_query_tables(node)
        for child in node.children:
            if isinstance(child, WhereNode):  # and child.children:
                tables |= set(get_tables(child, tables))
            elif not hasattr(child, '__iter__'):
                continue
            else:
                for item in (c for c in child if isinstance(c, QuerySet)):
                    tables |= get_tables_for_query(item.query)
        return tables

    if query.where and query.where.children:
        where_nodes = [c for c in query.where.children if isinstance(c, (WhereNode, SubqueryConstraint))]
        for node in where_nodes:
            tables |= get_tables(node, tables)

    return list(tables)
1300171
def _iter_table_records(self):
        
        count = self._table_count
        bufr = self._stream.read(offset=12, length=count*16)
        tmpl = '>4sLLL'
        for i in range(count):
            offset = i * 16
            tag, checksum, off, len_ = unpack_from(tmpl, bufr, offset)
            yield tag.decode('utf-8'), off, len_
420337
def _inception_table_links(self, href_list):
        
        tables = set()
        for link in href_list:
            if not link.startswith('http://'):
                link = self.agency_url + link
            html = urlopen(link).read()
            doc = lh.fromstring(html)
            area = doc.cssselect('map area')
            if area:
                # Then this is a model containing models.
                tables.update((a.attrib['href'] for a in area))
            else:
                # The link is a table without additional models.
                tables.update(link)
        return tables
11164
def get_table(self, tablename):
        
        temp = filter(lambda x: x.name == tablename, self.tables)
        if temp == list():
            raise Exception("No such table")
        return temp[0]
977770
def tables(self):
        
        select = ("SELECT name FROM sqlite_master",)
        query = self.execute(*select)
        result = query.fetchall()

        # Filter first column from rows.
        return [row[0] for row in result]
230368
def list_tables(self):
        
        lines = output_lines(self.exec_psql('\\dt'))
        return [line.split('|') for line in lines]
560310
def get_table_fields(self, db_table):
        
        db_table_desc = self.introspection.get_table_description(self.cursor, db_table)
        return [t[0] for t in db_table_desc]
506824
def readTables(self):
        
        class D: pass
        cur=self.cur
        cur.execute('SELECT * FROM users')
        D.users = cur.fetchall()
        cur.execute('SELECT * FROM profiles')
        D.profiles = cur.fetchall()
        cur.execute('SELECT * FROM articles')
        D.articles = cur.fetchall()
        cur.execute('SELECT * FROM comments')
        D.comments = cur.fetchall()
        cur.execute('SELECT * FROM friendships')
        D.friendships= cur.fetchall()
        cur.execute('SELECT * FROM votes')
        D.votes= cur.fetchall()
        cur.execute('SELECT * FROM tags')
        D.tags= cur.fetchall()
        cur.execute('SELECT * FROM taggings')
        D.taggings= cur.fetchall()
        self.D=D

        class N: pass
        cur.execute("select column_name from information_schema.columns where table_name='users';")
        UN=cur.fetchall()
        N.UN=[i[0] for i in UN[::-1]]
        cur.execute("select column_name from information_schema.columns where table_name='profiles';")
        PN=cur.fetchall()
        N.PN=[i[0] for i in PN[::-1]]
        cur.execute("select column_name from information_schema.columns where table_name='articles';")
        AN=cur.fetchall()
        N.AN=[i[0] for i in AN[::-1]]
        cur.execute("select column_name from information_schema.columns where table_name='comments';")
        CN=cur.fetchall()
        N.CN=[i[0] for i in CN[::-1]]
        cur.execute("select column_name from information_schema.columns where table_name='friendships';")
        FRN=cur.fetchall()
        N.FRN=[i[0] for i in FRN[::-1]]
        cur.execute("select column_name from information_schema.columns where table_name='votes';")
        VN=cur.fetchall()
        N.VN=[i[0] for i in VN[::-1]]
        cur.execute("select column_name from information_schema.columns where table_name='tags';")
        TN=cur.fetchall()
        N.TN=[i[0] for i in TN[::-1]]
        cur.execute("select column_name from information_schema.columns where table_name='taggings';")
        TTN=cur.fetchall()
        N.TTN=[i[0] for i in TTN[::-1]]
        self.N=N
1053674
def all_tables(self) -> List[str]:
        
        return sorted([k for k in self.__dict__.keys()
                       if k not in _I2B2Tables._funcs and not k.startswith("_")])
973859
def get_tables(self, table_name="", **kwargs):
        
        with self.connection(**kwargs) as connection:
            kwargs['connection'] = connection
            return self._get_tables(str(table_name), **kwargs)
544136
def list(self,table, **kparams):
        
        records = self.api.list(table, **kparams)
        return records
240335
def _parse_tables(self, soup):
        
        tables = []
        for t in soup.find_all('table'):
            t_dict = {'width': 0, 'table': t, 'trs': [], 'col_width': {}}
            trs = t.find_all('tr')
            if len(trs) > 0:
                for tr in trs:
                    tr_dict = []
                    tds = tr.find_all('th') + tr.find_all('td')
                    if len(tds) > 0:
                        for i, td in enumerate(tds):
                            td_text = self._find_any_text(td)
                            length = len(td_text)
                            if i in t_dict['col_width']:
                                t_dict['col_width'][i] = max(
                                    length,
                                    t_dict['col_width'][i]
                                )
                            else:
                                t_dict['col_width'][i] = length
                            tr_dict.append({
                                'text': td_text,
                                'colspan': int(td.get('colspan', 1)),
                            })
                        t_dict['trs'].append(tr_dict)
                for col in t_dict['col_width']:
                    t_dict['width'] += t_dict['col_width'][col]
                tables.append(t_dict)
        return tables
1241445
def parse_tables(self):
        
        tables = self._parse_tables(self._build_doc(), self.match, self.attrs)
        return (self._parse_thead_tbody_tfoot(table) for table in tables)
1070050
def _get_table_names(statement):
    

    parts = statement.to_unicode().split()

    tables = set()

    for i, token in enumerate(parts):
        if token.lower() == 'from' or token.lower().endswith('join'):
            tables.add(parts[i + 1].rstrip(';'))

    return list(tables)
657593
def rowget(self,tables_dict,row_list,index):
    ""
    tmp=row_list
    for i in self.index_tuple(tables_dict,index,False): tmp=tmp[i]
    return tmp
982710
def get_table_objects_by_name(self, dbname, tbl_names):
    
    self.send_get_table_objects_by_name(dbname, tbl_names)
    return self.recv_get_table_objects_by_name()