def insert(self, *args, **kwargs):
pks = []<EOL>if isinstance(args[<NUM_LIT:0>], Interface):<EOL><INDENT>interface = args[<NUM_LIT:0>]<EOL>schema = args[<NUM_LIT:1>]<EOL>count = args[<NUM_LIT:2>]<EOL>for i in range(count):<EOL><INDENT>fields = self.get_fields(schema)<EOL>pks.append(interface.insert(schema, fields, **kwargs))<EOL><DEDENT><DEDENT>elif isinstance(args[<NUM_LIT:0>], query.Query):<EOL><INDENT>q = args[<NUM_LIT:0>].copy()<EOL>q.reset()<EOL>count = args[<NUM_LIT:1>]<EOL>for i in range(count):<EOL><INDENT>fields = self.get_fields(q.orm_class.schema)<EOL>pks.append(q.copy().set(fields).insert())<EOL><DEDENT><DEDENT>elif issubclass(args[<NUM_LIT:0>], Orm):<EOL><INDENT>orm_class = args[<NUM_LIT:0>]<EOL>count = args[<NUM_LIT:1>]<EOL>for i in range(count):<EOL><INDENT>fields = self.get_fields(orm_class.schema)<EOL>o = orm_class.create(fields)<EOL>pks.append(o.pk)<EOL><DEDENT><DEDENT>assert count == len(pks)<EOL>for pk in pks:<EOL><INDENT>assert pk > <NUM_LIT:0><EOL><DEDENT>return pks<EOL>
most typically you will call this with (object, count)