def _create(self, tree):
tablename = tree.table<EOL>indexes = []<EOL>global_indexes = []<EOL>hash_key = None<EOL>range_key = None<EOL>attrs = {}<EOL>for declaration in tree.attrs:<EOL><INDENT>name, type_ = declaration[:<NUM_LIT:2>]<EOL>if len(declaration) > <NUM_LIT:2>:<EOL><INDENT>index = declaration[<NUM_LIT:2>]<EOL><DEDENT>else:<EOL><INDENT>index = None<EOL><DEDENT>if index is not None:<EOL><INDENT>if index[<NUM_LIT:0>] == "<STR_LIT>":<EOL><INDENT>field = hash_key = DynamoKey(name, data_type=TYPES[type_])<EOL><DEDENT>elif index[<NUM_LIT:0>] == "<STR_LIT>":<EOL><INDENT>field = range_key = DynamoKey(name, data_type=TYPES[type_])<EOL><DEDENT>else:<EOL><INDENT>index_type = index[<NUM_LIT:0>]<EOL>kwargs = {}<EOL>if index_type[<NUM_LIT:0>] in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>factory = LocalIndex.all<EOL><DEDENT>elif index_type[<NUM_LIT:0>] == "<STR_LIT>":<EOL><INDENT>factory = LocalIndex.keys<EOL><DEDENT>elif index_type[<NUM_LIT:0>] == "<STR_LIT>":<EOL><INDENT>factory = LocalIndex.include<EOL>kwargs["<STR_LIT>"] = [resolve(v) for v in index.include_vars]<EOL><DEDENT>index_name = resolve(index[<NUM_LIT:1>])<EOL>field = DynamoKey(name, data_type=TYPES[type_])<EOL>idx = factory(index_name, field, **kwargs)<EOL>indexes.append(idx)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>field = DynamoKey(name, data_type=TYPES[type_])<EOL><DEDENT>attrs[field.name] = field<EOL><DEDENT>for gindex in tree.global_indexes:<EOL><INDENT>global_indexes.append(self._parse_global_index(gindex, attrs))<EOL><DEDENT>throughput = None<EOL>if tree.throughput:<EOL><INDENT>throughput = Throughput(*map(resolve, tree.throughput))<EOL><DEDENT>try:<EOL><INDENT>ret = self.connection.create_table(<EOL>tablename,<EOL>hash_key,<EOL>range_key,<EOL>indexes=indexes,<EOL>global_indexes=global_indexes,<EOL>throughput=throughput,<EOL>)<EOL><DEDENT>except DynamoDBError as e:<EOL><INDENT>if e.kwargs["<STR_LIT>"] == "<STR_LIT>" or tree.not_exists:<EOL><INDENT>return False<EOL><DEDENT>raise<EOL><DEDENT>return True<EOL>
Run a SELECT statement