def executemany(self, sql, seq_of_parameters):
row_counts = []<EOL>durations = []<EOL>if self.connection.lowest_server_version >= BULK_INSERT_MIN_VERSION:<EOL><INDENT>self.execute(sql, bulk_parameters=seq_of_parameters)<EOL>for result in self._result.get('<STR_LIT>', []):<EOL><INDENT>if result.get('<STR_LIT>') > -<NUM_LIT:1>:<EOL><INDENT>row_counts.append(result.get('<STR_LIT>'))<EOL><DEDENT><DEDENT>if self.duration > -<NUM_LIT:1>:<EOL><INDENT>durations.append(self.duration)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for params in seq_of_parameters:<EOL><INDENT>self.execute(sql, parameters=params)<EOL>if self.rowcount > -<NUM_LIT:1>:<EOL><INDENT>row_counts.append(self.rowcount)<EOL><DEDENT>if self.duration > -<NUM_LIT:1>:<EOL><INDENT>durations.append(self.duration)<EOL><DEDENT><DEDENT><DEDENT>self._result = {<EOL>"<STR_LIT>": sum(row_counts) if row_counts else -<NUM_LIT:1>,<EOL>"<STR_LIT>": sum(durations) if durations else -<NUM_LIT:1>,<EOL>"<STR_LIT>": [],<EOL>"<STR_LIT>": self._result.get("<STR_LIT>", []),<EOL>"<STR_LIT>": self._result.get("<STR_LIT>")<EOL>}<EOL>self.rows = iter(self._result["<STR_LIT>"])<EOL>return self._result["<STR_LIT>"]<EOL>
Prepare a database operation (query or command) and then execute it
against all parameter sequences or mappings found in the sequence
``seq_of_parameters``.