Return a iterator of tables in this bundle
        :return:
193056
def tables(self):
        
        from ambry.orm import Table
        from sqlalchemy.orm import lazyload

        return (self.dataset.session.query(Table)
                .filter(Table.d_vid == self.dataset.vid)
                .options(lazyload('*'))
                .all())
1269005
def tables_(self) -> list:
        
        if self._check_db() == False:
            return
        try:
            return self._tables()
        except Exception as e:
            self.err(e, "Can not print tables")
1333349
def list_tables(self, dataset):
        

        request = self.client.tables().list(projectId=dataset.project_id,
                                            datasetId=dataset.dataset_id,
                                            maxResults=1000)
        response = request.execute()

        while response is not None:
            for t in response.get('tables', []):
                yield t['tableReference']['tableId']

            request = self.client.tables().list_next(request, response)
            if request is None:
                break

            response = request.execute()
960100
def table(self):
        
        if self._table is None:
            column_names = []
            for fileid in self.header.file_ids:
                for column_name in self.header.column_names:
                    column_names.append("{}_{}".format(column_name, fileid))
                column_names.append("ZP_{}".format(fileid))
            if len(column_names) > 0:
                self._table = Table(names=column_names)
            else:
                self._table = Table()
        return self._table
251926
def _tables(self):
        
        return dict(
            (tag, _TableFactory(tag, self._stream, off, len_))
            for tag, off, len_ in self._iter_table_records()
        )
357446
def _get_tables(self, ods):
        """"""

        childnodes = ods.spreadsheet.childNodes
        qname_childnodes = [(s.qname[1], s) for s in childnodes]
        return [node for name, node in qname_childnodes if name == u"table"]
1033755
def to_tables(cols):
  
  tables = OrderedDict()
  for col in cols:
    tname = col["table_name"]
    if tname not in tables:
      tables[tname] = OrderedDict()
    tables[tname][col["column_name"]] = col
  return tables
1112509
def table_definitions(self):
        
        prop = self._get_sub_prop("tableDefinitions")
        if prop is not None:
            prop = _from_api_repr_table_defs(prop)
        return prop
628594
public Collection<String> getTableNames() {
        Collection<String> result = new LinkedHashSet<>(tables.size(), 1);
        for (Table each : tables) {
            result.add(each.getName());
        }
        return result;
    }
850483
def structure(table_toplevels):
    

    table_toplevels = tuple(table_toplevels)
    obj = NamedDict()

    last_array_of_tables = None         # The Name of the last array-of-tables header

    for toplevel in table_toplevels:

        if isinstance(toplevel, toplevels.AnonymousTable):
            obj[''] = toplevel.table_element

        elif isinstance(toplevel, toplevels.Table):
            if last_array_of_tables and toplevel.name.is_prefixed_with(last_array_of_tables):
                seq = obj[last_array_of_tables]
                unprefixed_name = toplevel.name.without_prefix(last_array_of_tables)

                seq[-1] = CascadeDict(seq[-1], NamedDict({unprefixed_name: toplevel.table_element}))
            else:
                obj[toplevel.name] = toplevel.table_element
        else:    # It's an ArrayOfTables

            if last_array_of_tables and toplevel.name != last_array_of_tables and \
                    toplevel.name.is_prefixed_with(last_array_of_tables):

                seq = obj[last_array_of_tables]
                unprefixed_name = toplevel.name.without_prefix(last_array_of_tables)

                if unprefixed_name in seq[-1]:
                    seq[-1][unprefixed_name].append(toplevel.table_element)
                else:
                    cascaded_with = NamedDict({unprefixed_name: [toplevel.table_element]})
                    seq[-1] = CascadeDict(seq[-1], cascaded_with)

            else:
                obj.append(toplevel.name, toplevel.table_element)
                last_array_of_tables = toplevel.name

    return obj
1057256
def tables(self):
        """"""
        if len(self._tables) == 0:
            self.refresh_schema(self._exclude_system_tables, self._use_cache)
        return self._tables
245073
def get_table_names(self, connection, schema=None, **kw):
        
        return self._get_table_or_view_names('r', connection, schema, **kw)
1096016
def _list_tables_model(self, prefix='', project=None):
    
    tset = set()

    if prefix.startswith(TEMP_TABLE_PREFIX):
        prefix = TEMP_TABLE_MODEL_PREFIX + prefix[len(TEMP_TABLE_PREFIX):]
        it = self.list_tables(project=project, prefix=prefix)
    else:
        it = self.list_tables(project=project, prefix=TABLE_MODEL_PREFIX + prefix)
        if TEMP_TABLE_PREFIX.startswith(prefix):
            new_iter = self.list_tables(project=project, prefix=TEMP_TABLE_MODEL_PREFIX)
            it = itertools.chain(it, new_iter)

    for table in it:
        if TABLE_MODEL_SEPARATOR not in table.name:
            continue
        if not table.name.startswith(TEMP_TABLE_MODEL_PREFIX) and not table.name.startswith(TABLE_MODEL_PREFIX):
            continue
        model_name, _ = table.name.rsplit(TABLE_MODEL_SEPARATOR, 1)
        if model_name.startswith(TEMP_TABLE_MODEL_PREFIX):
            model_name = TEMP_TABLE_PREFIX + model_name[len(TEMP_TABLE_MODEL_PREFIX):]
        else:
            model_name = model_name[len(TABLE_MODEL_PREFIX):]
        if model_name not in tset:
            tset.add(model_name)
            yield TablesModelObject(_odps=self, name=model_name, project=project)
253117
def bundles_list(self, io_handler, name=None):
        
        # Head of the table
        headers = ("ID", "Name", "State", "Version")

        # Get the bundles
        bundles = self._context.get_bundles()

        # The framework is not in the result of get_bundles()
        bundles.insert(0, self._context.get_framework())

        if name is not None:
            # Filter the list
            bundles = [
                bundle
                for bundle in bundles
                if name in bundle.get_symbolic_name()
            ]

        # Make the entries
        lines = [
            [
                str(entry)
                for entry in (
                    bundle.get_bundle_id(),
                    bundle.get_symbolic_name(),
                    self._utils.bundlestate_to_str(bundle.get_state()),
                    bundle.get_version(),
                )
            ]
            for bundle in bundles
        ]

        # Print'em all
        io_handler.write(self._utils.make_table(headers, lines))

        if name is None:
            io_handler.write_line("{0} bundles installed", len(lines))
        else:
            io_handler.write_line("{0} filtered bundles", len(lines))
549882
def tables(subjects=None,
           pastDays=None,
           include_inactive=False,
           lang=DEFAULT_LANGUAGE):
    
    request = Request('tables',
                      subjects=subjects,
                      pastDays=pastDays,
                      includeInactive=include_inactive,
                      lang=lang)

    return (Table(table, lang=lang) for table in request.json)
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])
804068
def itersheets(self):
        
        for ws in self.worksheets:
            # Expression with no explicit table specified will use None
            # when calling get_table, which should return the current worksheet/table
            prev_ws = self.active_worksheet
            self.active_worksheet = ws
            try:
                yield ws
            finally:
                self.active_worksheet = prev_ws