<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _insert(self, tree):
 """ Run an INSERT statement """

        tablename = tree.table
        count = 0
        kwargs = {}
        batch = self.connection.batch_write(tablename, **kwargs)
        with batch:
            for item in iter_insert_items(tree):
                batch.put(item)
                count += 1
        return count