Metadata for a table entry.
176859
private void writeMetaTable(TableEntry entry)
  {
    TempBuffer tBuf = TempBuffer.create();
    byte []buffer = tBuf.buffer();
    
    int offset = 0;
    buffer[offset++] = CODE_TABLE;
    offset += BitsUtil.write(buffer, offset, entry.tableKey());
    offset += BitsUtil.writeInt16(buffer, offset, entry.rowLength());
    offset += BitsUtil.writeInt16(buffer, offset, entry.keyOffset());
    offset += BitsUtil.writeInt16(buffer, offset, entry.keyLength());
    
    byte []data = entry.data();
    offset += BitsUtil.writeInt16(buffer, offset, data.length);
    
    System.arraycopy(data, 0, buffer, offset, data.length);
    offset += data.length;
    
    int crc = _nonce;
    crc = Crc32Caucho.generate(crc, buffer, 0, offset);

    offset += BitsUtil.writeInt(buffer, offset, crc);
    
    // XXX: overflow
    try (OutStore sOut = openWrite(_metaOffset, offset)) {
      sOut.write(_metaOffset, buffer, 0, offset);
      _metaOffset += offset;
    }
    
    tBuf.free();
    
    if (_metaTail - _metaOffset < 16) {
      writeMetaContinuation();
    }
  }
323776
def stk_metadata(self):
        """"""
        if not self.is_stk:
            return None
        page = self.pages[0]
        tags = page.tags
        result = {}
        result['NumberPlanes'] = tags['UIC2tag'].count
        if page.description:
            result['PlaneDescriptions'] = page.description.split('\0')
            # result['plane_descriptions'] = stk_description_metadata(
            #    page.image_description)
        if 'UIC1tag' in tags:
            result.update(tags['UIC1tag'].value)
        if 'UIC3tag' in tags:
            result.update(tags['UIC3tag'].value)  # wavelengths
        if 'UIC4tag' in tags:
            result.update(tags['UIC4tag'].value)  # override uic1 tags
        uic2tag = tags['UIC2tag'].value
        result['ZDistance'] = uic2tag['ZDistance']
        result['TimeCreated'] = uic2tag['TimeCreated']
        result['TimeModified'] = uic2tag['TimeModified']
        try:
            result['DatetimeCreated'] = numpy.array(
                [julian_datetime(*dt) for dt in
                 zip(uic2tag['DateCreated'], uic2tag['TimeCreated'])],
                dtype='datetime64[ns]')
            result['DatetimeModified'] = numpy.array(
                [julian_datetime(*dt) for dt in
                 zip(uic2tag['DateModified'], uic2tag['TimeModified'])],
                dtype='datetime64[ns]')
        except ValueError as exc:
            log.warning('STK metadata: %s: %s', exc.__class__.__name__, exc)
        return result
622620
function Table(name, db, options) {
  this.name = name;
  this.db = db; // the name of the database
  this.options = options || {};
  this.options.primaryKey = this.options.primary_key || "id";
  this.documents = {};
  this.indexes = {}; // String -> FUNC terms
  this.indexes[this.options.primaryKey] = {
    //TODO Make me use TERMS
    //fn: function(doc) { return doc[name] },
    // 69=FUNC, 2=MAKE_ARRAY, 31=GET_FIELD, 10=VAR, 1=ARGUMENT_INDEX
    //TODO Use a uuid to avoid collision
    fn: [ 69, [ [ 2, [ 1 ] ], [ 31, [ [ 10, [ 1 ] ], this.options.primaryKey ] ] ] ],
    function: { /* TODO */ },
    geo: false,
    outdated: false,
    ready: true,
    multi: false
  };
  this.id = util.uuid();
  if (options.meta === true) {
    // meta table
    this.meta = true;
  }
}
897241
def mdgel_metadata(self):
        """"""
        for page in self.pages[:2]:
            if 'MDFileTag' in page.tags:
                tags = page.tags
                break
        else:
            return None
        result = {}
        for code in range(33445, 33453):
            name = TIFF.TAGS[code]
            if name not in tags:
                continue
            result[name[2:]] = tags[name].value
        return result
651797
def metadata():
    """"""
    with open(os.path.join(charm_dir(), 'metadata.yaml')) as md:
        return yaml.safe_load(md)
950872
function tableEntry(report) {
  const category = report.category;

  const color = category === 'error' ? red : yellow;

  return [ report.id || '', color(categoryMap[category] || category), report.message, report.name || '' ];
}
241518
def __meta_metadata(self, field, key):
        """"""
        mf = ''
        try:
            mf = str([f[key] for f in self.metadata
                     if f['field_name'] == field][0])
        except IndexError:
            print("%s not in metadata field:%s" % (key, field))
            return mf
        else:
            return mf
430828
def table_for_data( data )
    buf = ""
    buf << "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'></head><body>\n"
    buf << "<table>\n"
    data.each do |rec|
      buf << "  <tr>"
      rec.values.each do |value|
        buf << "<td>#{value}</td>"
      end
      buf << "</tr>\n"
    end
    buf << "</table>\n"
    buf << "</body></html>"
    buf
  end
608992
def to_dict(self):
        """"""
        return {"name": self.table_name, "kind": self.table_kind, "data": [r.to_dict() for r in self]}
309134
def metadata(self):
        """"""
        self.metadata_path = os.path.join(self.path, 'metadata.rb')
        if not os.path.isfile(self.metadata_path):
            raise ValueError("Cookbook needs metadata.rb, %s"
                             % self.metadata_path)

        if not self._metadata:
            self._metadata = MetadataRb(open(self.metadata_path, 'r+'))

        return self._metadata
1030601
def _metadata_keyword(self):
        
        with open(self.abspath) as fobj:
            for line in fobj:
                if 'PVTTABLE LABEL' in line:
                    label = re.findall(r"\=[\w\ \"]*\,", line)[0][1:-1]
                    self.metadata["fluids"].append(label)

                if 'PRESSURE = (' in line:
                    line = line.split('=')[1]
                    vals = re.findall(r'[\d\-\.eE+]+', line)
                    self.metadata['p_array'] = np.array([float(val) for val in
                                                         vals])
                if 'TEMPERATURE = (' in line:
                    line = line.split('=')[1]
                    vals = re.findall(r'[\d\-\.eE+]+', line)
                    self.metadata['t_array'] = np.array([float(val) for val in
                                                         vals])
                if 'COLUMNS = (' in line:
                    line = line.split('=')[1].replace(" ", "").\
                           replace('(', '').replace(')\n', '')
                    self.metadata['properties'] = line.split(',')
            self.metadata["t_points"] = len(self.metadata["t_array"])
            self.metadata["p_points"] = len(self.metadata["p_array"])
            self.metadata["nfluids"] = len(self.metadata["fluids"])
            self.data = pd.DataFrame(self.metadata["properties"])
1156652
def tables_for_meta(meta):
    
    allegedb.alchemy.tables_for_meta(meta)

    # Table for global variables that are not sensitive to sim-time.
    Table(
        'universals', meta,
        Column('key', TEXT, primary_key=True),
        Column(
            'branch', TEXT, primary_key=True, default='trunk'
        ),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT, primary_key=True, default=0),
        Column('value', TEXT)
    )

    Table(
        'rules', meta,
        Column('rule', TEXT, primary_key=True)
    )

    # Table grouping rules into lists called rulebooks.
    Table(
        'rulebooks', meta,
        Column('rulebook', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT, primary_key=True, default=0),
        Column('rules', TEXT, default='[]')
    )

    # Table for rules' triggers, those functions that return True only
    # when their rule should run (or at least check its prereqs).
    Table(
        'rule_triggers', meta,
        Column('rule', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT, primary_key=True, default=0),
        Column('triggers', TEXT, default='[]'),
        ForeignKeyConstraint(
            ['rule'], ['rules.rule']
        )
    )

    # Table for rules' prereqs, functions with veto power over a rule
    # being followed
    Table(
        'rule_prereqs', meta,
        Column('rule', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT, primary_key=True, default=0),
        Column('prereqs', TEXT, default='[]'),
        ForeignKeyConstraint(
            ['rule'], ['rules.rule']
        )
    )

    # Table for rules' actions, the functions that do what the rule
    # does.
    Table(
        'rule_actions', meta,
        Column('rule', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT, primary_key=True, default=0),
        Column('actions', TEXT, default='[]'),
        ForeignKeyConstraint(
            ['rule'], ['rules.rule']
        )
    )

    # The top level of the LiSE world model, the character. Includes
    # rulebooks for the character itself, its avatars, and all the things,
    # places, and portals it contains--though those may have their own
    # rulebooks as well.

    for name in (
        'character_rulebook',
        'avatar_rulebook',
        'character_thing_rulebook',
        'character_place_rulebook',
        'character_portal_rulebook'
    ):
        Table(
            name, meta,
            Column('character', TEXT, primary_key=True),
            Column('branch', TEXT, primary_key=True, default='trunk'),
            Column('turn', INT, primary_key=True, default=0),
            Column('tick', INT, primary_key=True, default=0),
            Column('rulebook', TEXT),
            ForeignKeyConstraint(
                ['character'], ['graphs.graph']
            ),
            ForeignKeyConstraint(
                ['rulebook'], ['rulebooks.rulebook']
            )
        )

    # Rules handled within the rulebook associated with one node in
    # particular.
    nrh = Table(
        'node_rules_handled', meta,
        Column('character', TEXT, primary_key=True),
        Column('node', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT),
        ForeignKeyConstraint(
            ['character', 'node'], ['nodes.graph', 'nodes.node']
        )
    )

    Table(
        'node_rules_changes', meta,
        Column('character', TEXT, primary_key=True),
        Column('node', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True),
        Column('turn', INT, primary_key=True),
        Column('tick', INT, primary_key=True),
        Column('handled_branch', TEXT),
        Column('handled_turn', INT),
        ForeignKeyConstraint(
            ['character', 'node', 'rulebook', 'rule', 'handled_branch', 'handled_turn'],
            [nrh.c.character, nrh.c.node, nrh.c.rulebook, nrh.c.rule, nrh.c.branch, nrh.c.turn]
        )
    )

    # Rules handled within the rulebook associated with one portal in
    # particular.
    porh = Table(
        'portal_rules_handled', meta,
        Column('character', TEXT, primary_key=True),
        Column('orig', TEXT, primary_key=True),
        Column('dest', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT),
        ForeignKeyConstraint(
            ['character', 'orig', 'dest'], ['edges.graph', 'edges.orig', 'edges.dest']
        )
    )

    Table(
        'portal_rules_changes', meta,
        Column('character', TEXT, primary_key=True),
        Column('orig', TEXT, primary_key=True),
        Column('dest', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True),
        Column('turn', INT, primary_key=True),
        Column('tick', INT, primary_key=True),
        Column('handled_branch', TEXT),
        Column('handled_turn', INT),
        ForeignKeyConstraint(
            ['character', 'orig', 'dest', 'rulebook', 'rule', 'handled_branch', 'handled_turn'],
            [porh.c.character, porh.c.orig, porh.c.dest, porh.c.rulebook, porh.c.rule, porh.c.branch, porh.c.turn]
        )
    )

    # The function to use for a given sense.
    #
    # Characters use senses to look at other characters. To model this,
    # sense functions are called with a facade representing the
    # character under observation; the function munges this facade to
    # make it look as it does through the sense in question, and returns
    # that.
    Table(
        'senses', meta,
        # null character field means all characters have this sense
        Column(
            'character', TEXT, primary_key=True, nullable=True
        ),
        Column('sense', TEXT, primary_key=True),
        Column(
            'branch', TEXT, primary_key=True, default='trunk'
        ),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT, primary_key=True, default=0),
        Column('function', TEXT, nullable=True),
        ForeignKeyConstraint(['character'], ['graphs.graph'])
    )

    # Table for Things, being those nodes in a Character graph that have
    # locations.
    #
    # A Thing's location can be either a Place or another Thing, as long
    # as it's in the same Character.
    Table(
        'things', meta,
        Column('character', TEXT, primary_key=True),
        Column('thing', TEXT, primary_key=True),
        Column(
            'branch', TEXT, primary_key=True, default='trunk'
        ),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT, primary_key=True, default=0),
        # when location is null, this node is not a thing, but a place
        Column('location', TEXT),
        ForeignKeyConstraint(
            ['character', 'thing'], ['nodes.graph', 'nodes.node']
        ),
        ForeignKeyConstraint(
            ['character', 'location'], ['nodes.graph', 'nodes.node']
        )
    )

    # The rulebook followed by a given node.
    Table(
        'node_rulebook', meta,
        Column('character', TEXT, primary_key=True),
        Column('node', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT, primary_key=True, default=0),
        Column('rulebook', TEXT),
        ForeignKeyConstraint(
            ['character', 'node'], ['nodes.graph', 'nodes.node']
        )
    )

    # The rulebook followed by a given Portal.
    #
    # "Portal" is LiSE's term for an edge in any of the directed
    # graphs it uses. The name is different to distinguish them from
    # Edge objects, which exist in an underlying object-relational
    # mapper called allegedb, and have a different API.
    Table(
        'portal_rulebook', meta,
        Column('character', TEXT, primary_key=True),
        Column('orig', TEXT, primary_key=True),
        Column('dest', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT, primary_key=True, default=0),
        Column('rulebook', TEXT),
        ForeignKeyConstraint(
            ['character', 'orig', 'dest'],
            ['edges.graph', 'edges.orig', 'edges.dest']
        )
    )

    # The avatars representing one Character in another.
    #
    # In the common situation where a Character, let's say Alice has her
    # own stats and skill tree and social graph, and also has a location
    # in physical space, you can represent this by creating a Thing in
    # the Character that represents physical space, and then making that
    # Thing an avatar of Alice. On its own this doesn't do anything,
    # it's just a convenient way of indicating the relation -- but if
    # you like, you can make rules that affect all avatars of some
    # Character, irrespective of what Character the avatar is actually
    # *in*.
    Table(
        'avatars', meta,
        Column('character_graph', TEXT, primary_key=True),
        Column('avatar_graph', TEXT, primary_key=True),
        Column('avatar_node', TEXT, primary_key=True),
        Column(
            'branch', TEXT, primary_key=True, default='trunk'
        ),
        Column('turn', INT, primary_key=True, default=0),
        Column('tick', INT, primary_key=True, default=0),
        Column('is_avatar', BOOLEAN),
        ForeignKeyConstraint(['character_graph'], ['graphs.graph']),
        ForeignKeyConstraint(
            ['avatar_graph', 'avatar_node'],
            ['nodes.graph', 'nodes.node']
        )
    )

    crh = Table(
        'character_rules_handled', meta,
        Column('character', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True),
        Column('tick', INT),
        ForeignKeyConstraint(
            ['character', 'rulebook'], ['character_rulebook.character', 'character_rulebook.rulebook']
        )
    )

    Table(
        'character_rules_changes', meta,
        Column('character', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True),
        Column('turn', INT, primary_key=True),
        Column('tick', INT, primary_key=True),
        Column('handled_branch', TEXT),
        Column('handled_turn', TEXT),
        ForeignKeyConstraint(
            ['character', 'rulebook', 'rule', 'handled_branch', 'handled_turn'],
            [crh.c.character, crh.c.rulebook, crh.c.rule, crh.c.branch, crh.c.turn]
        )
    )

    arh = Table(
        'avatar_rules_handled', meta,
        Column('character', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('graph', TEXT, primary_key=True),
        Column('avatar', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True),
        Column('tick', INT),
        ForeignKeyConstraint(
            ['character', 'rulebook'], ['avatar_rulebook.character', 'avatar_rulebook.rulebook']
        )
    )

    Table(
        'avatar_rules_changes', meta,
        Column('character', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('graph', TEXT, primary_key=True),
        Column('avatar', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True),
        Column('turn', INT, primary_key=True),
        Column('tick', INT, primary_key=True),
        Column('handled_branch', TEXT),
        Column('handled_turn', TEXT),
        ForeignKeyConstraint(
            ['character', 'rulebook', 'rule', 'graph', 'avatar', 'handled_branch', 'handled_turn'],
            [arh.c.character, arh.c.rulebook, arh.c.rule, arh.c.graph, arh.c.avatar, arh.c.branch, arh.c.turn]
        )
    )

    ctrh = Table(
        'character_thing_rules_handled', meta,
        Column('character', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('thing', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True),
        Column('tick', INT),
        ForeignKeyConstraint(
            ['character', 'rulebook'], ['character_thing_rulebook.character', 'character_thing_rulebook.rulebook']
        ),
        ForeignKeyConstraint(
            ['character', 'thing'], ['things.character', 'things.thing']
        )
    )

    Table(
        'character_thing_rules_changes', meta,
        Column('character', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('thing', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True),
        Column('turn', INT, primary_key=True),
        Column('tick', INT, primary_key=True),
        Column('handled_branch', TEXT),
        Column('handled_turn', INT),
        ForeignKeyConstraint(
            ['character', 'rulebook', 'rule', 'thing', 'handled_branch', 'handled_turn'],
            [ctrh.c.character, ctrh.c.rulebook, ctrh.c.rule, ctrh.c.thing, ctrh.c.branch, ctrh.c.turn]
        )
    )

    cprh = Table(
        'character_place_rules_handled', meta,
        Column('character', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('place', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True),
        Column('tick', INT),
        ForeignKeyConstraint(
            ['character', 'rulebook'], ['character_place_rulebook.character', 'character_place_rulebook.rulebook']
        ),
        ForeignKeyConstraint(
            ['character', 'place'], ['nodes.graph', 'nodes.node']
        )
    )

    Table(
        'character_place_rules_changes', meta,
        Column('character', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('place', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True),
        Column('turn', INT, primary_key=True),
        Column('tick', INT, primary_key=True),
        Column('handled_branch', TEXT),
        Column('handled_turn', INT),
        ForeignKeyConstraint(
            ['character', 'rulebook', 'rule', 'place', 'handled_branch', 'handled_turn'],
            [cprh.c.character, cprh.c.rulebook, cprh.c.rule, cprh.c.place, cprh.c.branch, cprh.c.turn]
        )
    )

    cporh = Table(
        'character_portal_rules_handled', meta,
        Column('character', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('orig', TEXT, primary_key=True),
        Column('dest', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True, default='trunk'),
        Column('turn', INT, primary_key=True),
        Column('tick', INT),
        ForeignKeyConstraint(
            ['character', 'rulebook'], ['character_portal_rulebook.character', 'character_portal_rulebook.rulebook']
        ),
        ForeignKeyConstraint(
            ['character', 'orig', 'dest'], ['edges.graph', 'edges.orig', 'edges.dest']
        )
    )

    Table(
        'character_portal_rules_changes', meta,
        Column('character', TEXT, primary_key=True),
        Column('rulebook', TEXT, primary_key=True),
        Column('rule', TEXT, primary_key=True),
        Column('orig', TEXT, primary_key=True),
        Column('dest', TEXT, primary_key=True),
        Column('branch', TEXT, primary_key=True),
        Column('turn', INT, primary_key=True),
        Column('tick', INT, primary_key=True),
        Column('handled_branch', TEXT),
        Column('handled_turn', INT),
        ForeignKeyConstraint(
            ['character', 'rulebook', 'rule', 'orig', 'dest', 'handled_branch', 'handled_turn'],
            [cporh.c.character, cporh.c.rulebook, cporh.c.rule, cporh.c.orig, cporh.c.dest, cporh.c.branch, cporh.c.turn]
        )
    )

    Table(
        'turns_completed', meta,
        Column('branch', TEXT, primary_key=True),
        Column('turn', INT)
    )

    return meta.tables
654362
def get_table_description(self, cursor, table_name):
        ""
        # As cursor.description does not return reliably the nullable property,
        # we have to query the information_schema (#7783)
        cursor.execute("""
            SELECT column_name, is_nullable, column_default
            FROM information_schema.columns
            WHERE table_schema = %s and table_name = %s""", [self.connection.schema_name, table_name])
        field_map = {line[0]: line[1:] for line in cursor.fetchall()}
        cursor.execute("SELECT * FROM %s LIMIT 1" % self.connection.ops.quote_name(table_name))
        return [FieldInfo(*((force_text(line[0]),) + line[1:6] +
                            (field_map[force_text(line[0])][0] == 'YES', field_map[force_text(line[0])][1])))
                for line in cursor.description]
34279
def get_tables_for_bind(self, bind=None):
        """"""
        result = []
        tables = Model.metadata.tables
        for key in tables:
            if tables[key].info.get("bind_key") == bind:
                result.append(tables[key])
        return result
43463
def column_names(self, table):
      """"""

      table_info = self.execute(
        u'PRAGMA table_info(%s)' % quote(table))
      return (column['name'] for column in table_info)
717935
def metadata(self):
        

        sheet = self.result.add_sheet("metadata")
        self.header(sheet, "metadata")

        n_row = 1  # row number

        for k in self.po.metadata:
            row = sheet.row(n_row)
            row.write(0, k)
            row.write(1, self.po.metadata[k])
            n_row += 1
            sheet.flush_row_data()
292309
def get_column_metadata(conn, table: str, schema='public'):
    """"""
    query = """\
SELECT
  attname as name,
  format_type(atttypid, atttypmod) AS data_type,
  NOT attnotnull AS nullable
FROM pg_catalog.pg_attribute
WHERE attrelid=%s::regclass
  AND attnum > 0 AND NOT attisdropped
ORDER BY attnum;"""

    qualified_name = compile_qualified_name(table, schema=schema)

    for record in select_dict(conn, query, params=(qualified_name,)):
        yield record