def group_transactions(self):<EOL>
groups = []<EOL>if self:<EOL><INDENT>last_txn = self.tail_transaction<EOL>current_group = [last_txn]<EOL>for current_txn in self.transactions[<NUM_LIT:1>:]:<EOL><INDENT>if current_txn.address == last_txn.address:<EOL><INDENT>current_group.append(current_txn)<EOL><DEDENT>else:<EOL><INDENT>groups.append(current_group)<EOL>current_group = [current_txn]<EOL><DEDENT>last_txn = current_txn<EOL><DEDENT>if current_group:<EOL><INDENT>groups.append(current_group)<EOL><DEDENT><DEDENT>return groups<EOL>
Groups transactions in the bundle by address.