Return list of materialized view for table.
194942
public static List<Table> getMaterializeViews(org.voltdb.catalog.Database database,
                                                       org.voltdb.catalog.Table table)
    {
        ArrayList<Table> tlist = new ArrayList<>();
        CatalogMap<Table> tables = database.getTables();
        for (Table t : tables) {
            Table matsrc = t.getMaterializer();
            if ((matsrc != null) && (matsrc.getRelativeIndex() == table.getRelativeIndex())) {
                tlist.add(t);
            }
        }
        return tlist;
    }
685706
def _GetTable(self):
    
    result = []
    # Avoid the global lookup cost on each iteration.
    lstr = str
    for row in self._table:
      result.append(
          '%s\n' %
          self.separator.join(lstr(v) for v in row))

    return ''.join(result)
1090812
def get_view(self, view_name, timestamp):
        """"""
        view = self._registered_views.get(view_name)
        if view is None:
            return None

        view_data_list = self._measure_to_view_data_list_map.get(
            view.measure.name)

        if not view_data_list:
            return None

        for view_data in view_data_list:
            if view_data.view.name == view_name:
                break
        else:
            return None

        return self.copy_and_finalize_view_data(view_data)
388450
def _get_indexes(self, schema, **kwargs):
        """"""
        # http://www.sqlite.org/pragma.html#schema
        # http://www.mail-archive.com/sqlite-users@sqlite.org/msg22055.html
        # http://stackoverflow.com/questions/604939/
        ret = {}
        rs = self._query('PRAGMA index_list({})'.format(self._normalize_table_name(schema)), **kwargs)
        if rs:
            for r in rs:
                iname = r['name']
                ret.setdefault(iname, [])
                indexes = self._query('PRAGMA index_info({})'.format(r['name']), **kwargs)
                for idict in indexes:
                    ret[iname].append(idict['name'])

        return ret
230368
def list_tables(self):
        
        lines = output_lines(self.exec_psql('\\dt'))
        return [line.split('|') for line in lines]
542995
def get_database_rows(self, tables=None, database=None):
        """"""
        # Get table data and columns from source database
        source = database if database else self.database
        tables = tables if tables else self.tables

        # Get database select queries
        commands = self._get_select_commands(source, tables)

        # Execute select commands
        return self._execute_select_commands(source, commands)
813405
def _get_rows(self, table):
        """"""

        childnodes = table.childNodes
        qname_childnodes = [(s.qname[1], s) for s in childnodes]
        return [node for name, node in qname_childnodes
                if name == u'table-row']
1208914
def items(self):
        
        return [
            (c.name, getattr(self, c.name, None))
            for c in self.__table__._columns
        ]
114978
def ReadAllArtifacts(self, cursor=None):
    """"""
    cursor.execute("SELECT definition FROM artifacts")
    return [_RowToArtifact(row) for row in cursor.fetchall()]
524719
def GetListItems(self, viewname=None, fields=None, query=None, rowlimit=0, debug=False):
        

        # Build Request
        soap_request = soap('GetListItems')
        soap_request.add_parameter('listName', self.listName)
        # Convert Displayed View Name to View ID
        if viewname:
            soap_request.add_parameter('viewName', self.views[viewname]['Name'][1:-1])

        # Add viewFields
        if fields:
            # Convert to SharePoint Style Column Names
            for i, val in enumerate(fields):
                fields[i] = self._disp_cols[val]['name']
            viewfields = fields
            soap_request.add_view_fields(fields)
            # Check for viewname and query
            if [viewname, query] == [None, None]:
                # Add a query if the viewname and query are not provided
                # We sort by 'ID' here Ascending is the default
                soap_request.add_query({'OrderBy': ['ID']})

        elif viewname:
            viewfields = self.GetView(viewname)['fields']  ## Might be wrong
        else:
            # No fields or views provided so get everything
            viewfields = [x for x in self._sp_cols]

        # Add query
        if query:

            if 'Where' in query:
                where = etree.Element('Where')

                parents = []
                parents.append(where)
                for i, field in enumerate(query['Where']):
                    if field == 'And':
                        parents.append(etree.SubElement(parents[-1], 'And'))
                    elif field == 'Or':
                        if parents[-1].tag == 'Or':
                            parents.pop()
                        parents.append(etree.SubElement(parents[-1], 'Or'))
                    else:
                        _type = etree.SubElement(parents[-1], field[0])
                        field_ref = etree.SubElement(_type, 'FieldRef')
                        field_ref.set('Name', self._disp_cols[field[1]]['name'])
                        if len(field) == 3:
                            value = etree.SubElement(_type, 'Value')
                            value.set('Type', self._disp_cols[field[1]]['type'])
                            value.text = self._sp_type(field[1], field[2])

                query['Where'] = where

            soap_request.add_query(query)

        # Set Row Limit
        soap_request.add_parameter('rowLimit', str(rowlimit))
        self.last_request = str(soap_request)

        # Send Request
        response = self._session.post(url=self._url('Lists'),
                                      headers=self._headers('GetListItems'),
                                      data=str(soap_request),
                                      verify=self._verify_ssl,
                                      timeout=self.timeout)

        # Parse Response
        if response.status_code == 200:
            envelope = etree.fromstring(response.text.encode('utf-8'), parser=etree.XMLParser(huge_tree=self.huge_tree))
            listitems = envelope[0][0][0][0][0]
            data = []
            for row in listitems:
                # Strip the 'ows_' from the beginning with key[4:]
                data.append({key[4:]: value for (key, value) in row.items() if key[4:] in viewfields})

            self._convert_to_display(data)

            if debug:
                return response
            else:
                return data
        else:
            return response
38923
def list_tables(self):
        
        # Server does not do pagination on listings of this resource.
        # Return an iterator anyway for similarity with other API methods
        path = '/archive/{}/tables'.format(self._instance)
        response = self._client.get_proto(path=path)
        message = rest_pb2.ListTablesResponse()
        message.ParseFromString(response.content)
        tables = getattr(message, 'table')
        return iter([Table(table) for table in tables])
1114700
def _table_materialize(table):
    
    if table._is_materialized():
        return table

    op = ops.MaterializedJoin(table)
    return op.to_expr()
199938
def _list_model(self, model_cls: Type[X]) -> List[X]:
        """"""
        return self.session.query(model_cls).all()
331463
def get_fields(self):
        """"""
        fields = super(DataSerializer, self).get_fields()

        # Hide collections/entities fields on list views as fetching them may be expensive.
        if self.parent is not None:
            del fields['collections']
            del fields['entities']

        return fields
213717
def _return_rows(self, table, cols, values, return_type):
        """"""
        if return_type is dict:
            # Pack each row into a dictionary
            cols = self.get_columns(table) if cols is '*' else cols
            if len(values) > 0 and isinstance(values[0], (set, list, tuple)):
                return [dict(zip(cols, row)) for row in values]
            else:
                return dict(zip(cols, values))
        elif return_type is tuple:
            return [tuple(row) for row in values]
        else:
            return values
1114190
private function _dataForView()
    {
        return [
            'collection_generator' => $this->_config['collection_generator'],
            'columns'              => $this->_getColumns(),
            'collection'           => $this->_collection,
            'paginator'            => $this->_config['paginator_presenter'],
            'table'                => $this,
            'extra'                => $this->_config['extra'],
        ];
    }
590914
def _get_table(self):
        
        data = get_inner_data(self.report)
        labels = data.keys()
        row = [
            data[key]
            for key in labels
        ]
        return list(labels), [row]