Return a sequence of (name,type) pairs where type is
      either "table" or "view".
550950
def tablesAndViews(self):
      """"""
      result = self.execute(
        u'SELECT name,type FROM sqlite_master WHERE type in ("table", "view")',
        commit=False)
      return ((row['name'],row['type']) for row in result)
929279
def fetch_all_objects_from_db_by_pklist(self,
                                            cls: Type,
                                            table: str,
                                            fieldlist: Sequence[str],
                                            pklist: Sequence[Any],
                                            construct_with_pk: bool,
                                            *args) -> List[T]:
        """"""
        objarray = []
        for pk in pklist:
            if construct_with_pk:
                obj = cls(pk, *args)  # should do its own fetching
            else:
                obj = cls(*args)
                self.fetch_object_from_db_by_pk(obj, table, fieldlist, pk)
            objarray.append(obj)
        return objarray
748584
def fetch(table, cols="*", where=(), group="", order=(), limit=(), **kwargs):
    """"""
    return select(table, cols, where, group, order, limit, **kwargs).fetchall()
225022
@Override
    public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException
    {
        checkClosed();
        this.sysCatalog.setString(1, "TABLES");
        JDBC4ResultSet res = (JDBC4ResultSet) this.sysCatalog.executeQuery();
        VoltTable vtable = res.getVoltTable().clone(0);

        List<String> typeStrings = null;
        if (types != null) {
            typeStrings = Arrays.asList(types);
        }

        // If no pattern is specified, default to matching any/all.
        if (tableNamePattern == null || tableNamePattern.length() == 0)
        {
            tableNamePattern = "%";
        }

        Pattern table_pattern = computeJavaPattern(tableNamePattern);

        // Filter tables based on type and pattern
        while (res.next()) {
            if (typeStrings == null || typeStrings.contains(res.getString("TABLE_TYPE"))) {
                Matcher table_matcher = table_pattern.matcher(res.getString("TABLE_NAME"));
                if (table_matcher.matches())
                {
                    vtable.addRow(res.getRowData());
                }
            }
        }

        return new JDBC4ResultSet(this.sysCatalog, vtable);
    }
745784
def table_names(self):
        """"""
        query = "SELECT name FROM sqlite_master WHERE type='table'"
        cursor = self.connection.execute(query)
        results = cursor.fetchall()
        return [result_tuple[0] for result_tuple in results]
1113407
def get_table(self, schema_type):
        """"""
        table_name = schema_type.lower()
        if not self.has_table(table_name):
            raise exceptions.GraphQLCompilationError(
                'No Table found in SQLAlchemy metadata for table name "{}"'.format(table_name)
            )
        return self.table_name_to_table[table_name]
282430
def _Pairs(data):
    """"""
    keys = sorted(data)
    return [{'@key': k, '@value': data[k]} for k in keys]
991122
def _typelist(x):
    """"""
    if isinstance(x, collections.Sequence):
        return list(map(_to_instance, x))
    elif isinstance(x, collections.Iterable):
        return x
    return None if x is None else [_to_instance(x)]
568308
def _process_names(self, names):
        
        if names is None:
            return []

        table_names = OrderedDict()  # Preserve order and ignore duplicates
        while len(names):
            name = names.pop(0)
            if hasattr(name, '_meta'):
                if name._meta.abstract:
                    raise ValueError("Can't lock abstract model {}"
                                     .format(name.__name__))

                table_names[name._meta.db_table] = True
                # Include all parent models - the keys are the model classes
                if name._meta.parents:
                    names.extend(name._meta.parents.keys())
            else:
                table_names[name] = True
        return table_names.keys()
1208482
def _get_table_rows(parent_table, table_name, row_name):
        
        if parent_table is None:
            return []
        _table = parent_table.get(table_name)
        _table_rows = []
        if isinstance(_table, list):
            _table_rows = [_table_row.get(row_name) for _table_row in _table]
        elif isinstance(_table, dict):
            _table_rows = _table.get(row_name)
        if not isinstance(_table_rows, list):
            _table_rows = [_table_rows]
        return _table_rows
325503
def find_one(self, cls, id):
        """"""
        db_result = None
        for rec in read_rec(cls.get_table_name(), id):
            db_result = rec
            break  # Only read the first returned - which should be all we get
        if not db_result:
            return None

        obj = cls.from_data(db_result['value'])
        return obj
1164947
def get_view_names(self, connection, schema=None, **kw):
        
        return self._get_table_or_view_names('v', connection, schema, **kw)
949607
function getProcessedViews(id, next){

	// Create query
	if(id) query = {id: id};
	else   query = {};

	app.models.View.find(query, function(err, models){
		if(err) return next(err);

		processView(models, next);
	});
}
981282
def query_sequence(self):
    
    if not self.entries.seq: return None
    if self.check_flag(0x10): return rc(self.entries.seq)
    return self.entries.seq
563715
def group_by_types(self):
        """"""
        for t in self.types_of_specie:
            for site in self:
                if site.specie == t:
                    yield site
264552
def count_by_type(self,table,timesteps):
        """"""
        hbonds = defaultdict(int)
        for contact in table:
            #count by residue name not by proteinring
            pkey = (contact.donor_idx,contact.acceptor_idx,contact.donor_atom, contact.acceptor_atom,contact.donor_resnm,contact.donor_resid, contact.acceptor_resnm,contact.acceptor_resid)
            hbonds[pkey]+=1
        dtype = [("donor_idx",int),("acceptor_idx",int),("donor_atom","|U4"),("acceptor_atom","|U4"),("donor_resnm","|U8"),("donor_resid","|U8"),("acceptor_resnm","|U8"),("acceptor_resid","|U8"),("frequency",float) ]
        out = np.empty((len(hbonds),),dtype=dtype)
        tsteps = float(len(timesteps))
        for cursor,(key,count) in enumerate(hbonds.iteritems()):
            out[cursor] = key + (count / tsteps,)
        return out.view(np.recarray)
71449
def count_of_certain_kind(kind):
        '''
        
        '''

        recs = TabWiki.select().where(TabWiki.kind == kind)

        return recs.count()