def describe(self, tablename, refresh=False, metrics=False, require=False):
table = self.cached_descriptions.get(tablename)<EOL>if refresh or table is None or (metrics and not table.consumed_capacity):<EOL><INDENT>desc = self.connection.describe_table(tablename)<EOL>if desc is None:<EOL><INDENT>if require:<EOL><INDENT>raise RuntimeError("<STR_LIT>" % tablename)<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>table = TableMeta.from_description(desc)<EOL>self.cached_descriptions[tablename] = table<EOL>if metrics:<EOL><INDENT>read, write = self.get_capacity(tablename)<EOL>table.consumed_capacity["<STR_LIT>"] = {"<STR_LIT>": read, "<STR_LIT>": write}<EOL>for index_name in table.global_indexes:<EOL><INDENT>read, write = self.get_capacity(tablename, index_name)<EOL>table.consumed_capacity[index_name] = {"<STR_LIT>": read, "<STR_LIT>": write}<EOL><DEDENT><DEDENT><DEDENT>return table<EOL>
Get the :class:`.TableMeta` for a table