<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def executemany(self, query, args):
 """Run several data against one query In other form of queries, just run :meth:`execute` many times. """

        if not args:
            return

        m = RE_INSERT_VALUES.match(query)
        if m:
            q_prefix = m.group(1)
            q_values = m.group(2).rstrip()
            q_postfix = m.group(3) or ''
            assert q_values[0] == '(' and q_values[-1] == ')'
            yield self._do_execute_many(q_prefix, q_values, q_postfix, args,
                                        self.max_stmt_length,
                                        self._get_db().encoding)
        else:
            rows = 0
            for arg in args:
                yield self.execute(query, arg)
                rows += self.rowcount
            self.rowcount = rows
        raise gen.Return(self.rowcount)