def write(self, rows, keyed=False):
for row in rows:<EOL><INDENT>keyed_row = row<EOL>if not keyed:<EOL><INDENT>keyed_row = dict(zip(self.__schema.field_names, row))<EOL><DEDENT>keyed_row = self.__convert_row(keyed_row)<EOL>if self.__check_existing(keyed_row):<EOL><INDENT>for wr in self.__insert():<EOL><INDENT>yield wr<EOL><DEDENT>ret = self.__update(keyed_row)<EOL>if ret is not None:<EOL><INDENT>yield WrittenRow(keyed_row, True, ret if self.__autoincrement else None)<EOL>continue<EOL><DEDENT><DEDENT>self.__buffer.append(keyed_row)<EOL>if len(self.__buffer) > BUFFER_SIZE:<EOL><INDENT>for wr in self.__insert():<EOL><INDENT>yield wr<EOL><DEDENT><DEDENT><DEDENT>for wr in self.__insert():<EOL><INDENT>yield wr<EOL><DEDENT>
Write rows/keyed_rows to table