def _update_throughput(self, tablename, read, write, index):
def get_desc():<EOL><INDENT>"""<STR_LIT>"""<EOL>desc = self.describe(tablename, refresh=True, require=True)<EOL>if index is not None:<EOL><INDENT>return desc.global_indexes[index]<EOL><DEDENT>return desc<EOL><DEDENT>desc = get_desc()<EOL>def num_or_star(value):<EOL><INDENT>"""<STR_LIT>"""<EOL>return <NUM_LIT:0> if value == "<STR_LIT:*>" else resolve(value)<EOL><DEDENT>read = num_or_star(read)<EOL>write = num_or_star(write)<EOL>if read <= <NUM_LIT:0>:<EOL><INDENT>read = desc.read_throughput<EOL><DEDENT>if write <= <NUM_LIT:0>:<EOL><INDENT>write = desc.write_throughput<EOL><DEDENT>throughput = Throughput(read, write)<EOL>kwargs = {}<EOL>if index:<EOL><INDENT>kwargs["<STR_LIT>"] = {index: throughput}<EOL><DEDENT>else:<EOL><INDENT>kwargs["<STR_LIT>"] = throughput<EOL><DEDENT>self.connection.update_table(tablename, **kwargs)<EOL>desc = get_desc()<EOL>while desc.status == "<STR_LIT>":  <EOL><INDENT>time.sleep(<NUM_LIT:5>)<EOL>desc = get_desc()<EOL><DEDENT>
Update the throughput on a table or index